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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- const a0_0xe56496=a0_0x21aa;function a0_0x3f8d(){const _0x4a9137=['2578740piEjvK','match','alias','content','agent','signal','6HfLHqt','20919771fedgok','/events/','startsWith','AbortError','heartbeatInterval','body','cwd','name','server','send_message','7136792qcmnvK','Bearer\x20','POST','get_inbox','heartbeatTimer','min','split','196Pibald','sdk','SSE\x20reconnecting\x20in\x20','inbox\x20error:\x20','connected','error','Authorization','stringify','application/json,\x20text/event-stream','resumeId','slice','getReader','data:\x20','broadcast','SSE\x20failed:\x20','message','replace','2.0','send_task','SSE\x20connected','catch','running','sdk-','SSE\x20error:\x20','reconnectDelay','connectSSE','text/event-stream','decode','application/json','processInbox','url','1839250uQdbnk','get_all_status','disconnected','read','text','status','parse','type','/mcp','getAllStatus','sleep','token','toTimeString','99335fIloNt','tools/call','disconnect','log','now','reply','call','messages','result','120378GoPuqt','emit','connect','normal','sseAbort','abort','autoConnect','56176UGbDEl','from_session','registered','offline','pop',']\x20[commhub:','send'];a0_0x3f8d=function(){return _0x4a9137;};return a0_0x3f8d();}(function(_0x34082c,_0x501ea9){const _0x53b2d3=a0_0x21aa,_0x5582ac=_0x34082c();while(!![]){try{const _0x5093cf=-parseInt(_0x53b2d3(0xe3))/0x1+-parseInt(_0x53b2d3(0xd6))/0x2+parseInt(_0x53b2d3(0x100))/0x3*(parseInt(_0x53b2d3(0xf3))/0x4)+-parseInt(_0x53b2d3(0xfa))/0x5+parseInt(_0x53b2d3(0xec))/0x6*(parseInt(_0x53b2d3(0x112))/0x7)+-parseInt(_0x53b2d3(0x10b))/0x8+parseInt(_0x53b2d3(0x101))/0x9;if(_0x5093cf===_0x501ea9)break;else _0x5582ac['push'](_0x5582ac['shift']());}catch(_0x5745a3){_0x5582ac['push'](_0x5582ac['shift']());}}}(a0_0x3f8d,0x77028));import{EventEmitter as a0_0x4ba4d5}from'events';function a0_0x21aa(_0x236b3b,_0x5e9125){_0x236b3b=_0x236b3b-0xc9;const _0x3f8d50=a0_0x3f8d();let _0x21aa57=_0x3f8d50[_0x236b3b];return _0x21aa57;}import{hostname as a0_0x59d8ff}from'os';class T extends a0_0x4ba4d5{[a0_0xe56496(0xd5)];[a0_0xe56496(0xfc)];['token'];['agent'];[a0_0xe56496(0x11b)];[a0_0xe56496(0x105)];['reconnectDelay'];[a0_0xe56496(0x10f)];[a0_0xe56496(0xf0)];[a0_0xe56496(0xcc)]=!0x1;constructor(_0x3ee33a){const _0x5b2b26=a0_0xe56496;super();if(this[_0x5b2b26(0xd5)]=_0x3ee33a[_0x5b2b26(0xd5)][_0x5b2b26(0x122)](/\/$/,''),this[_0x5b2b26(0xfc)]=_0x3ee33a['alias'],this[_0x5b2b26(0xe1)]=_0x3ee33a[_0x5b2b26(0xe1)],this[_0x5b2b26(0xfe)]=_0x3ee33a['agent']||_0x5b2b26(0x113),this[_0x5b2b26(0x11b)]=_0x5b2b26(0xcd)+_0x3ee33a[_0x5b2b26(0xfc)]+'-'+Date[_0x5b2b26(0xe7)]()['toString'](0x24),this['heartbeatInterval']=_0x3ee33a[_0x5b2b26(0x105)]??0x2bf20,this[_0x5b2b26(0xcf)]=_0x3ee33a[_0x5b2b26(0xcf)]??0xbb8,_0x3ee33a[_0x5b2b26(0xf2)]!==!0x1)this[_0x5b2b26(0xee)]();}[a0_0xe56496(0xe6)](_0x39ae2f){const _0x34a88d=a0_0xe56496;console[_0x34a88d(0xe6)]('['+new Date()[_0x34a88d(0xe2)]()[_0x34a88d(0x11c)](0x0,0x8)+_0x34a88d(0xf8)+this[_0x34a88d(0xfc)]+']\x20'+_0x39ae2f);}async['call'](_0xd2f045,_0x130a7c){const _0x2ad07c=a0_0xe56496;let _0x40851a={'Content-Type':_0x2ad07c(0xd3),'Accept':_0x2ad07c(0x11a)};if(this[_0x2ad07c(0xe1)])_0x40851a[_0x2ad07c(0x118)]=_0x2ad07c(0x10c)+this['token'];let _0x2dae39=await(await fetch(this['url']+_0x2ad07c(0xde),{'method':_0x2ad07c(0x10d),'headers':_0x40851a,'body':JSON[_0x2ad07c(0x119)]({'jsonrpc':_0x2ad07c(0x123),'id':Date[_0x2ad07c(0xe7)](),'method':_0x2ad07c(0xe4),'params':{'name':_0xd2f045,'arguments':_0x130a7c}})}))['text'](),_0x5ee0df=_0x2dae39[_0x2ad07c(0xfb)](/data: (.+)/),_0x175e3c=_0x5ee0df?JSON[_0x2ad07c(0xdc)](_0x5ee0df[0x1]):JSON[_0x2ad07c(0xdc)](_0x2dae39),_0x124f37=_0x175e3c?.[_0x2ad07c(0xeb)]?.[_0x2ad07c(0xfd)]?.[0x0]?.[_0x2ad07c(0xda)];return _0x124f37?JSON[_0x2ad07c(0xdc)](_0x124f37):_0x175e3c;}async[a0_0xe56496(0xee)](){const _0x3e0afd=a0_0xe56496;if(this['running'])return;this[_0x3e0afd(0xcc)]=!0x0,await this['status']('idle'),this[_0x3e0afd(0xe6)](_0x3e0afd(0xf5)),this[_0x3e0afd(0x10f)]=setInterval(()=>{const _0x4d9496=_0x3e0afd;this[_0x4d9496(0xdb)]('idle')[_0x4d9496(0xcb)](_0x168bff=>this[_0x4d9496(0xe6)]('heartbeat\x20failed:\x20'+_0x168bff[_0x4d9496(0x121)]));},this['heartbeatInterval']),this[_0x3e0afd(0xd0)]();}async[a0_0xe56496(0xe5)](){const _0x882e0a=a0_0xe56496;if(this[_0x882e0a(0xcc)]=!0x1,this['sseAbort']?.[_0x882e0a(0xf1)](),this['heartbeatTimer'])clearInterval(this[_0x882e0a(0x10f)]);await this[_0x882e0a(0xdb)](_0x882e0a(0xf6))[_0x882e0a(0xcb)](()=>{}),this['log'](_0x882e0a(0xd8));}async[a0_0xe56496(0xf9)](_0x3e3bd5,_0x1c55a3,_0xdec2c7=a0_0xe56496(0xef)){const _0x233664=a0_0xe56496;return this[_0x233664(0xe9)](_0x233664(0xc9),{'alias':_0x3e3bd5,'task':_0x1c55a3,'priority':_0xdec2c7,'from_session':this[_0x233664(0xfc)]});}async[a0_0xe56496(0x121)](_0x5b69c3,_0x5d53d4){const _0x2c7576=a0_0xe56496;return this[_0x2c7576(0xe9)](_0x2c7576(0x10a),{'alias':_0x5b69c3,'message':_0x5d53d4,'from_session':this[_0x2c7576(0xfc)]});}async[a0_0xe56496(0xe8)](_0x1418b7,_0x106c8c,_0x30f7da='completed'){return this['call']('send_reply',{'in_reply_to':_0x1418b7,'text':_0x106c8c,'status':_0x30f7da});}async[a0_0xe56496(0xdb)](_0x368b79,_0x34ceba){const _0x378cd1=a0_0xe56496;return this[_0x378cd1(0xe9)]('report_status',{'resume_id':this[_0x378cd1(0x11b)],'alias':this[_0x378cd1(0xfc)],'status':_0x368b79,'server':a0_0x59d8ff(),'hostname':a0_0x59d8ff(),'agent':this[_0x378cd1(0xfe)],'project_dir':process[_0x378cd1(0x107)](),..._0x34ceba});}async[a0_0xe56496(0xdf)](){const _0x27b375=a0_0xe56496;return this['call'](_0x27b375(0xd7),{});}async[a0_0xe56496(0x11f)](_0x2503e3,_0x12b8af){const _0x2c2b26=a0_0xe56496;return this[_0x2c2b26(0xe9)](_0x2c2b26(0x11f),{'message':_0x2503e3,'filter_server':_0x12b8af?.[_0x2c2b26(0x109)],'filter_status':_0x12b8af?.[_0x2c2b26(0xdb)]});}async['connectSSE'](){const _0x129d93=a0_0xe56496;let _0x3a9d4=encodeURIComponent(this[_0x129d93(0xfc)]),_0x4643b5=this[_0x129d93(0xd5)]+_0x129d93(0x102)+_0x3a9d4,_0x34b290=this[_0x129d93(0xcf)];while(this[_0x129d93(0xcc)]){try{this[_0x129d93(0xf0)]=new AbortController();let _0x32079e={'Accept':_0x129d93(0xd1)};if(this[_0x129d93(0xe1)])_0x32079e[_0x129d93(0x118)]='Bearer\x20'+this[_0x129d93(0xe1)];let _0x4576f3=await fetch(_0x4643b5,{'headers':_0x32079e,'signal':this[_0x129d93(0xf0)][_0x129d93(0xff)]});if(!_0x4576f3['ok']||!_0x4576f3['body']){this[_0x129d93(0xe6)](_0x129d93(0x120)+_0x4576f3[_0x129d93(0xdb)]),await this[_0x129d93(0xe0)](_0x34b290),_0x34b290=Math[_0x129d93(0x110)](_0x34b290*1.5,0xea60);continue;}_0x34b290=this[_0x129d93(0xcf)];let _0x1fecf5=_0x4576f3[_0x129d93(0x106)][_0x129d93(0x11d)](),_0x206f52=new TextDecoder(),_0x2c0fc0='';while(this['running']){let {done:_0x4702c9,value:_0x59f073}=await _0x1fecf5[_0x129d93(0xd9)]();if(_0x4702c9)break;_0x2c0fc0+=_0x206f52[_0x129d93(0xd2)](_0x59f073,{'stream':!0x0});let _0x21ee4b=_0x2c0fc0[_0x129d93(0x111)]('\x0a');_0x2c0fc0=_0x21ee4b[_0x129d93(0xf7)]()||'';for(let _0x343d8e of _0x21ee4b){if(!_0x343d8e[_0x129d93(0x103)](_0x129d93(0x11e)))continue;try{let _0x2f160b=JSON['parse'](_0x343d8e['slice'](0x6));if(_0x2f160b[_0x129d93(0xdd)]==='connected'){this[_0x129d93(0xe6)](_0x129d93(0xca)),this[_0x129d93(0xed)](_0x129d93(0x116));continue;}if(_0x2f160b[_0x129d93(0xdd)]==='new_task'||_0x2f160b[_0x129d93(0xdd)]==='new_message'||_0x2f160b[_0x129d93(0xdd)]===_0x129d93(0x11f))await this[_0x129d93(0xd4)]();}catch{}}}}catch(_0x36c6ac){if(_0x36c6ac[_0x129d93(0x108)]===_0x129d93(0x104))break;this[_0x129d93(0xed)](_0x129d93(0x117),_0x36c6ac),this[_0x129d93(0xe6)](_0x129d93(0xce)+_0x36c6ac[_0x129d93(0x121)]);}if(this[_0x129d93(0xcc)])this[_0x129d93(0xed)](_0x129d93(0xd8)),this[_0x129d93(0xe6)](_0x129d93(0x114)+_0x34b290/0x3e8+'s...'),await this[_0x129d93(0xe0)](_0x34b290),_0x34b290=Math[_0x129d93(0x110)](_0x34b290*1.5,0xea60);}}async[a0_0xe56496(0xd4)](){const _0x59e435=a0_0xe56496;try{let _0x5bde6d=(await this[_0x59e435(0xe9)](_0x59e435(0x10e),{'alias':this[_0x59e435(0xfc)],'limit':0xa}))?.[_0x59e435(0xea)]||[];for(let _0x4a1fee of _0x5bde6d)await this['call']('ack_inbox',{'alias':this['alias'],'message_id':_0x4a1fee['id']}),this[_0x59e435(0xe6)]('←\x20'+_0x4a1fee[_0x59e435(0xf4)]+':\x20'+_0x4a1fee[_0x59e435(0xfd)][_0x59e435(0x11c)](0x0,0x3c)),this[_0x59e435(0xed)]('task',_0x4a1fee),this[_0x59e435(0xed)](_0x59e435(0x121),_0x4a1fee);}catch(_0x2e008e){this['log'](_0x59e435(0x115)+_0x2e008e[_0x59e435(0x121)]);}}[a0_0xe56496(0xe0)](_0x4f07db){return new Promise(_0x39f9c6=>setTimeout(_0x39f9c6,_0x4f07db));}}var $=T;export{$ as default,T as CommHub};
1
+ function a0_0x1ee0(_0x34e0fc,_0x128736){_0x34e0fc=_0x34e0fc-0x188;const _0x1c9e79=a0_0x1c9e();let _0x1ee00f=_0x1c9e79[_0x34e0fc];return _0x1ee00f;}const a0_0x1108f5=a0_0x1ee0;(function(_0x2976a5,_0x2e6190){const _0x204abb=a0_0x1ee0,_0x850ae=_0x2976a5();while(!![]){try{const _0x2f1cf7=-parseInt(_0x204abb(0x1d5))/0x1*(parseInt(_0x204abb(0x1cd))/0x2)+parseInt(_0x204abb(0x1d2))/0x3*(-parseInt(_0x204abb(0x1bf))/0x4)+-parseInt(_0x204abb(0x1dd))/0x5+-parseInt(_0x204abb(0x1b5))/0x6*(-parseInt(_0x204abb(0x1be))/0x7)+-parseInt(_0x204abb(0x190))/0x8+-parseInt(_0x204abb(0x1a7))/0x9*(-parseInt(_0x204abb(0x1a6))/0xa)+-parseInt(_0x204abb(0x1c3))/0xb*(-parseInt(_0x204abb(0x188))/0xc);if(_0x2f1cf7===_0x2e6190)break;else _0x850ae['push'](_0x850ae['shift']());}catch(_0x28e2fb){_0x850ae['push'](_0x850ae['shift']());}}}(a0_0x1c9e,0x8722c));import{EventEmitter as a0_0x99f645}from'events';function a0_0x1c9e(){const _0x410c89=['Authorization','alias','normal','text/event-stream','log','url','10rZndIR','777429bcOoaE','SSE\x20connected','replace','token','get_inbox','/events/','emit','result','heartbeatTimer','min','message','match','sdk-','cwd','6zpazWq','connected','send','sseAbort','registered','task','offline','content','autoConnect','636545MHFiwU','100IGhiYu','messages','signal','server','55oyfiYK','startsWith','toTimeString','now','broadcast','SSE\x20error:\x20','ack_inbox','text','connect','call','1925246RnvCpt','processInbox','body','slice','reconnectDelay','108522eQLqIj','SSE\x20reconnecting\x20in\x20','split','1hHMBkZ','pop','heartbeatInterval','type','completed','stringify','disconnected','new_task','1468280TNQBJJ','error','catch','Bearer\x20','s...','reply','disconnect','8110236sDqXhe','application/json','from_session','connectSSE',']\x20[commhub:','send_message','read','getReader','6739488WGAoNf','heartbeat\x20failed:\x20','parse','status','running','/mcp','sdk','send_task','resumeId','sleep','agent','idle','decode','2.0','new_message','application/json,\x20text/event-stream'];a0_0x1c9e=function(){return _0x410c89;};return a0_0x1c9e();}import{hostname as a0_0x49496f}from'os';class T extends a0_0x99f645{['url'];[a0_0x1108f5(0x1a1)];[a0_0x1108f5(0x1aa)];[a0_0x1108f5(0x19a)];[a0_0x1108f5(0x198)];[a0_0x1108f5(0x1d7)];[a0_0x1108f5(0x1d1)];[a0_0x1108f5(0x1af)];[a0_0x1108f5(0x1b8)];[a0_0x1108f5(0x194)]=!0x1;constructor(_0x559d8c){const _0x54cf5f=a0_0x1108f5;super();if(this[_0x54cf5f(0x1a5)]=_0x559d8c['url'][_0x54cf5f(0x1a9)](/\/$/,''),this['alias']=_0x559d8c['alias'],this['token']=_0x559d8c[_0x54cf5f(0x1aa)],this['agent']=_0x559d8c['agent']||_0x54cf5f(0x196),this[_0x54cf5f(0x198)]=_0x54cf5f(0x1b3)+_0x559d8c[_0x54cf5f(0x1a1)]+'-'+Date[_0x54cf5f(0x1c6)]()['toString'](0x24),this[_0x54cf5f(0x1d7)]=_0x559d8c['heartbeatInterval']??0x2bf20,this['reconnectDelay']=_0x559d8c[_0x54cf5f(0x1d1)]??0xbb8,_0x559d8c[_0x54cf5f(0x1bd)]!==!0x1)this[_0x54cf5f(0x1cb)]();}[a0_0x1108f5(0x1a4)](_0x1c6de1){const _0x3df66d=a0_0x1108f5;console['log']('['+new Date()[_0x3df66d(0x1c5)]()[_0x3df66d(0x1d0)](0x0,0x8)+_0x3df66d(0x18c)+this[_0x3df66d(0x1a1)]+']\x20'+_0x1c6de1);}async[a0_0x1108f5(0x1cc)](_0x32c042,_0x10cec5){const _0x4a1fc8=a0_0x1108f5;let _0x483fd7={'Content-Type':_0x4a1fc8(0x189),'Accept':_0x4a1fc8(0x19f)};if(this[_0x4a1fc8(0x1aa)])_0x483fd7[_0x4a1fc8(0x1a0)]=_0x4a1fc8(0x1e0)+this[_0x4a1fc8(0x1aa)];let _0xfebd21=await(await fetch(this[_0x4a1fc8(0x1a5)]+_0x4a1fc8(0x195),{'method':'POST','headers':_0x483fd7,'body':JSON[_0x4a1fc8(0x1da)]({'jsonrpc':_0x4a1fc8(0x19d),'id':Date[_0x4a1fc8(0x1c6)](),'method':'tools/call','params':{'name':_0x32c042,'arguments':_0x10cec5}})}))[_0x4a1fc8(0x1ca)](),_0x561e97=_0xfebd21[_0x4a1fc8(0x1b2)](/data: (.+)/),_0x56b284=_0x561e97?JSON[_0x4a1fc8(0x192)](_0x561e97[0x1]):JSON[_0x4a1fc8(0x192)](_0xfebd21),_0x333306=_0x56b284?.[_0x4a1fc8(0x1ae)]?.['content']?.[0x0]?.[_0x4a1fc8(0x1ca)];return _0x333306?JSON[_0x4a1fc8(0x192)](_0x333306):_0x56b284;}async[a0_0x1108f5(0x1cb)](){const _0x5333fe=a0_0x1108f5;if(this['running'])return;this[_0x5333fe(0x194)]=!0x0,await this['status'](_0x5333fe(0x19b)),this[_0x5333fe(0x1a4)](_0x5333fe(0x1b9)),this['heartbeatTimer']=setInterval(()=>{const _0x2b3326=_0x5333fe;this[_0x2b3326(0x193)](_0x2b3326(0x19b))[_0x2b3326(0x1df)](_0x1be803=>this[_0x2b3326(0x1a4)](_0x2b3326(0x191)+_0x1be803[_0x2b3326(0x1b1)]));},this[_0x5333fe(0x1d7)]),this[_0x5333fe(0x18b)]();}async[a0_0x1108f5(0x1e3)](){const _0x1dc7d5=a0_0x1108f5;if(this[_0x1dc7d5(0x194)]=!0x1,this['sseAbort']?.['abort'](),this[_0x1dc7d5(0x1af)])clearInterval(this[_0x1dc7d5(0x1af)]);await this[_0x1dc7d5(0x193)](_0x1dc7d5(0x1bb))[_0x1dc7d5(0x1df)](()=>{}),this[_0x1dc7d5(0x1a4)](_0x1dc7d5(0x1db));}async[a0_0x1108f5(0x1b7)](_0x45fc72,_0x360e15,_0x4c7bcd=a0_0x1108f5(0x1a2)){const _0x1ec537=a0_0x1108f5;return this[_0x1ec537(0x1cc)](_0x1ec537(0x197),{'alias':_0x45fc72,'task':_0x360e15,'priority':_0x4c7bcd,'from_session':this[_0x1ec537(0x1a1)]});}async[a0_0x1108f5(0x1b1)](_0x28dd43,_0x3e67cb){const _0x549832=a0_0x1108f5;return this[_0x549832(0x1cc)](_0x549832(0x18d),{'alias':_0x28dd43,'message':_0x3e67cb,'from_session':this['alias']});}async[a0_0x1108f5(0x1e2)](_0x3ab6c5,_0x4428ac,_0x2397fb=a0_0x1108f5(0x1d9)){const _0x5c07db=a0_0x1108f5;return this[_0x5c07db(0x1cc)]('send_reply',{'in_reply_to':_0x3ab6c5,'text':_0x4428ac,'status':_0x2397fb});}async[a0_0x1108f5(0x193)](_0x753d0d,_0x430167){const _0x31a5c2=a0_0x1108f5;return this[_0x31a5c2(0x1cc)]('report_status',{'resume_id':this[_0x31a5c2(0x198)],'alias':this[_0x31a5c2(0x1a1)],'status':_0x753d0d,'server':a0_0x49496f(),'hostname':a0_0x49496f(),'agent':this['agent'],'project_dir':process[_0x31a5c2(0x1b4)](),..._0x430167});}async['getAllStatus'](){const _0x57c6ed=a0_0x1108f5;return this[_0x57c6ed(0x1cc)]('get_all_status',{});}async[a0_0x1108f5(0x1c7)](_0x141f32,_0x133ecf){const _0x4a44a6=a0_0x1108f5;return this[_0x4a44a6(0x1cc)](_0x4a44a6(0x1c7),{'message':_0x141f32,'filter_server':_0x133ecf?.[_0x4a44a6(0x1c2)],'filter_status':_0x133ecf?.[_0x4a44a6(0x193)]});}async['connectSSE'](){const _0x17dd77=a0_0x1108f5;let _0x14da93=encodeURIComponent(this[_0x17dd77(0x1a1)]),_0x28f3d8=this[_0x17dd77(0x1a5)]+_0x17dd77(0x1ac)+_0x14da93,_0xe557b1=this[_0x17dd77(0x1d1)];while(this['running']){try{this[_0x17dd77(0x1b8)]=new AbortController();let _0x592cb9={'Accept':_0x17dd77(0x1a3)};if(this['token'])_0x592cb9[_0x17dd77(0x1a0)]=_0x17dd77(0x1e0)+this[_0x17dd77(0x1aa)];let _0x1e9b93=await fetch(_0x28f3d8,{'headers':_0x592cb9,'signal':this[_0x17dd77(0x1b8)][_0x17dd77(0x1c1)]});if(!_0x1e9b93['ok']||!_0x1e9b93[_0x17dd77(0x1cf)]){this[_0x17dd77(0x1a4)]('SSE\x20failed:\x20'+_0x1e9b93[_0x17dd77(0x193)]),await this[_0x17dd77(0x199)](_0xe557b1),_0xe557b1=Math[_0x17dd77(0x1b0)](_0xe557b1*1.5,0xea60);continue;}_0xe557b1=this[_0x17dd77(0x1d1)];let _0x1d6248=_0x1e9b93['body'][_0x17dd77(0x18f)](),_0x45c4df=new TextDecoder(),_0x5163a2='';while(this['running']){let {done:_0x1d7bbd,value:_0x1f5037}=await _0x1d6248[_0x17dd77(0x18e)]();if(_0x1d7bbd)break;_0x5163a2+=_0x45c4df[_0x17dd77(0x19c)](_0x1f5037,{'stream':!0x0});let _0x1c43ae=_0x5163a2[_0x17dd77(0x1d4)]('\x0a');_0x5163a2=_0x1c43ae[_0x17dd77(0x1d6)]()||'';for(let _0x5688d2 of _0x1c43ae){if(!_0x5688d2[_0x17dd77(0x1c4)]('data:\x20'))continue;try{let _0x2cfc97=JSON[_0x17dd77(0x192)](_0x5688d2[_0x17dd77(0x1d0)](0x6));if(_0x2cfc97['type']==='connected'){this['log'](_0x17dd77(0x1a8)),this[_0x17dd77(0x1ad)](_0x17dd77(0x1b6));continue;}if(_0x2cfc97[_0x17dd77(0x1d8)]===_0x17dd77(0x1dc)||_0x2cfc97[_0x17dd77(0x1d8)]===_0x17dd77(0x19e)||_0x2cfc97[_0x17dd77(0x1d8)]==='broadcast')await this[_0x17dd77(0x1ce)]();}catch{}}}}catch(_0x1cf7a6){if(_0x1cf7a6['name']==='AbortError')break;this[_0x17dd77(0x1ad)](_0x17dd77(0x1de),_0x1cf7a6),this[_0x17dd77(0x1a4)](_0x17dd77(0x1c8)+_0x1cf7a6['message']);}if(this[_0x17dd77(0x194)])this[_0x17dd77(0x1ad)]('disconnected'),this[_0x17dd77(0x1a4)](_0x17dd77(0x1d3)+_0xe557b1/0x3e8+_0x17dd77(0x1e1)),await this[_0x17dd77(0x199)](_0xe557b1),_0xe557b1=Math['min'](_0xe557b1*1.5,0xea60);}}async['processInbox'](){const _0x312255=a0_0x1108f5;try{let _0x3d3b70=(await this[_0x312255(0x1cc)](_0x312255(0x1ab),{'alias':this['alias'],'limit':0xa}))?.[_0x312255(0x1c0)]||[];for(let _0x1a5dcc of _0x3d3b70)await this[_0x312255(0x1cc)](_0x312255(0x1c9),{'alias':this['alias'],'message_id':_0x1a5dcc['id']}),this[_0x312255(0x1a4)]('←\x20'+_0x1a5dcc[_0x312255(0x18a)]+':\x20'+_0x1a5dcc[_0x312255(0x1bc)]['slice'](0x0,0x3c)),this[_0x312255(0x1ad)](_0x312255(0x1ba),_0x1a5dcc),this[_0x312255(0x1ad)]('message',_0x1a5dcc);}catch(_0x4ff953){this[_0x312255(0x1a4)]('inbox\x20error:\x20'+_0x4ff953[_0x312255(0x1b1)]);}}[a0_0x1108f5(0x199)](_0x537190){return new Promise(_0x377a72=>setTimeout(_0x377a72,_0x537190));}}var $=T;export{$ as default,T as CommHub};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- const a0_0x2e1510=a0_0x5823;(function(_0x2d5b84,_0x4e7b8b){const _0x537a52=a0_0x5823,_0x312afe=_0x2d5b84();while(!![]){try{const _0x5656ec=-parseInt(_0x537a52(0x22f))/0x1*(-parseInt(_0x537a52(0x230))/0x2)+parseInt(_0x537a52(0x207))/0x3+parseInt(_0x537a52(0x266))/0x4+-parseInt(_0x537a52(0x224))/0x5+-parseInt(_0x537a52(0x272))/0x6+parseInt(_0x537a52(0x256))/0x7*(-parseInt(_0x537a52(0x265))/0x8)+parseInt(_0x537a52(0x26a))/0x9*(parseInt(_0x537a52(0x24b))/0xa);if(_0x5656ec===_0x4e7b8b)break;else _0x312afe['push'](_0x312afe['shift']());}catch(_0x34247f){_0x312afe['push'](_0x312afe['shift']());}}}(a0_0x352f,0xd917d));import{readFileSync as a0_0x566543,existsSync as a0_0xe8655c}from'fs';import{randomUUID as a0_0x150588}from'crypto';import{join as a0_0x11249b}from'path';import{hostname as a0_0x56c48a}from'os';import{execSync as a0_0x1c8edb}from'child_process';import{Server as a0_0x288d38}from'@modelcontextprotocol/sdk/server/index.js';function a0_0x352f(){const _0x2a49dc=['ready\x20—\x20waiting\x20for\x20events','parse','init\x20failed:\x20','connected','priority','starting\x20SSE\x20listener...','messages','toTimeString','...\x20TMUX=','replied','send_message','commhub_reply','statusText','high','stdin','claude-code','SSE\x20connected\x20as\x20\x22','set','getReader','\x20ALIAS=','12923410ZuoMia','normal','commhub','config.json','get_inbox','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','ack_inbox','slice','setRequestHandler','\x20priority=','catch','7BfjRDK','SSE\x20fatal:\x20','trim','send_reply','replace','then','←\x20message\x20from\x20','Reply\x20text\x20/\x20result\x20summary','parse\x20error:\x20','failed','Bearer\x20','message_id','notification','CommHub\x20init\x20failed:\x20','object','13991280YXUKFh','5003912eYwmhn','result','number','delete','27bMUHPx','stderr','ENV:\x20URL=','working','length','content','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','error','9976062tajeoo','idle','new_task','Session\x20alias:\x20','status','alias','unknown\x20tool','registered\x20as\x20\x22','cwd','application/json','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','commhub_send_message','0.3.0','connecting\x20to\x20','type','connect','initialize','\x22\x20(','split','string','read','\x20from\x20','SSE\x20connection\x20error:\x20','Target\x20session\x20alias','SIGTERM','application/json,\x20text/event-stream','\x20RESUME_ID=','report_status','/events/',':\x20inbox_count=','notifications/claude/channel','session\x20disconnected','.env','find','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','stringify','2243166alxEXN','token','join','tmux\x20display-message\x20-p\x20\x27#S\x27','cancelled','from','\x20PROJECT_ENV=','exit','utf-8','commhub_report_status','from_session','hub','Authorization','broadcast','Progress\x200-100','get','\x20CWD=','commhub_send_task','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','send_task','2.0','commhub-channel','text','.anet','message','/mcp','data:\x20','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','startsWith','7996710UdOmQN','POST','warning:\x20could\x20not\x20register:\x20','decode','indexOf','.claude/channels/commhub','SSE\x20stream\x20ended,\x20reconnecting...','→\x20injected\x20task\x20','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','completed','24419Ouhdga','2RbquUu','none','MCP\x20stdio\x20connected','get_all_status','Message\x20content','blocked','new_message'];a0_0x352f=function(){return _0x2a49dc;};return a0_0x352f();}import{StdioServerTransport as a0_0x14ed2c}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x426b8c,CallToolRequestSchema as a0_0x2eadca}from'@modelcontextprotocol/sdk/types.js';function p(_0x571ea7){const _0x162c31=a0_0x5823;if(!a0_0xe8655c(_0x571ea7))return;for(let _0x266154 of a0_0x566543(_0x571ea7,_0x162c31(0x20f))['split']('\x0a')){let _0x59dd0d=_0x266154[_0x162c31(0x258)]();if(!_0x59dd0d||_0x59dd0d[_0x162c31(0x223)]('#'))continue;let _0x1ad316=_0x59dd0d[_0x162c31(0x228)]('=');if(_0x1ad316<0x0)continue;let _0x234343=_0x59dd0d['slice'](0x0,_0x1ad316)['trim'](),_0x2fd496=_0x59dd0d[_0x162c31(0x252)](_0x1ad316+0x1)['trim']()[_0x162c31(0x25a)](/^["']|["']$/g,'');if(!process.env[_0x234343])process.env[_0x234343]=_0x2fd496;}}var C=process.env.HOME||'~',T=a0_0x11249b(C,a0_0x2e1510(0x229));p(a0_0x11249b(T,a0_0x2e1510(0x203)));function a0_0x5823(_0x4f71a5,_0x529631){_0x4f71a5=_0x4f71a5-0x1e6;const _0x352fb6=a0_0x352f();let _0x582332=_0x352fb6[_0x4f71a5];return _0x582332;}var L=process[a0_0x2e1510(0x1eb)]()['replace'](/\//g,'-');p(a0_0x11249b(T,L,a0_0x2e1510(0x203)));function U(){const _0x48892f=a0_0x2e1510;try{return a0_0x1c8edb(_0x48892f(0x20a),{'encoding':_0x48892f(0x20f),'timeout':0x7d0})[_0x48892f(0x258)]();}catch{return'';}}function v(){const _0x402d93=a0_0x2e1510;try{let _0x5a130d=a0_0x11249b(C,_0x402d93(0x21e),_0x402d93(0x24e));if(a0_0xe8655c(_0x5a130d))return JSON[_0x402d93(0x238)](a0_0x566543(_0x5a130d,'utf-8'));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x2e1510(0x212)]||'http://127.0.0.1:9200',j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x56c48a(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x150588(),X=process.env.COMMHUB_TOKEN||H[a0_0x2e1510(0x208)]||'';function Y(_0x23c53e){const _0x11f672=a0_0x2e1510;let _0x105ea7=new Date()[_0x11f672(0x23e)]()[_0x11f672(0x252)](0x0,0x8);process[_0x11f672(0x26b)]['write']('['+_0x105ea7+']\x20[commhub]\x20'+_0x23c53e+'\x0a');}function h(_0x3badb9){return new Promise(_0x52d519=>setTimeout(_0x52d519,_0x3badb9));}Y(a0_0x2e1510(0x26c)+f+a0_0x2e1510(0x24a)+Z+a0_0x2e1510(0x1fd)+w[a0_0x2e1510(0x252)](0x0,0x8)+a0_0x2e1510(0x23f)+(j||a0_0x2e1510(0x231))+a0_0x2e1510(0x217)+process['cwd']()+a0_0x2e1510(0x20d)+L);var k=new Map(),K=new a0_0x288d38({'name':a0_0x2e1510(0x21c),'version':a0_0x2e1510(0x1ef)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x2e1510(0x250),a0_0x2e1510(0x22c),a0_0x2e1510(0x219),a0_0x2e1510(0x205),a0_0x2e1510(0x1e6)+Z][a0_0x2e1510(0x209)]('\x0a')});K[a0_0x2e1510(0x253)](a0_0x426b8c,async()=>({'tools':[{'name':'commhub_reply','description':a0_0x2e1510(0x22d),'inputSchema':{'type':a0_0x2e1510(0x264),'properties':{'task_id':{'type':a0_0x2e1510(0x1f6),'description':a0_0x2e1510(0x222)},'text':{'type':a0_0x2e1510(0x1f6),'description':a0_0x2e1510(0x25d)},'status':{'type':a0_0x2e1510(0x1f6),'enum':[a0_0x2e1510(0x22e),a0_0x2e1510(0x25f),a0_0x2e1510(0x20b),'blocked',a0_0x2e1510(0x271),'in_progress'],'description':a0_0x2e1510(0x1ed)}},'required':[a0_0x2e1510(0x21d)]}},{'name':a0_0x2e1510(0x210),'description':a0_0x2e1510(0x270),'inputSchema':{'type':a0_0x2e1510(0x264),'properties':{'status':{'type':a0_0x2e1510(0x1f6),'enum':[a0_0x2e1510(0x26d),a0_0x2e1510(0x273),a0_0x2e1510(0x235),a0_0x2e1510(0x271)]},'task':{'type':a0_0x2e1510(0x1f6),'description':'Current\x20task\x20description'},'progress':{'type':a0_0x2e1510(0x268),'description':a0_0x2e1510(0x215)}},'required':[a0_0x2e1510(0x1e7)]}},{'name':a0_0x2e1510(0x218),'description':'Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','inputSchema':{'type':a0_0x2e1510(0x264),'properties':{'alias':{'type':'string','description':'Target\x20session\x20alias'},'task':{'type':a0_0x2e1510(0x1f6),'description':'Task\x20content'},'priority':{'type':'string','enum':[a0_0x2e1510(0x244),a0_0x2e1510(0x24c),'low'],'description':'Priority\x20(default:\x20normal)'}},'required':[a0_0x2e1510(0x1e8),'task']}},{'name':a0_0x2e1510(0x1ee),'description':'Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','inputSchema':{'type':a0_0x2e1510(0x264),'properties':{'alias':{'type':a0_0x2e1510(0x1f6),'description':a0_0x2e1510(0x1fa)},'message':{'type':'string','description':a0_0x2e1510(0x234)}},'required':[a0_0x2e1510(0x1e8),a0_0x2e1510(0x21f)]}},{'name':'commhub_get_all_status','description':'Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','inputSchema':{'type':a0_0x2e1510(0x264),'properties':{}}}]}));async function P(_0x2ca91c,_0x3d91a3){const _0x148e70=a0_0x2e1510;let _0x359971=await fetch(f+_0x148e70(0x220),{'method':_0x148e70(0x225),'headers':{'Content-Type':_0x148e70(0x1ec),'Accept':_0x148e70(0x1fc),...X?{'Authorization':_0x148e70(0x260)+X}:{}},'body':JSON[_0x148e70(0x206)]({'jsonrpc':_0x148e70(0x21b),'id':0x1,'method':_0x148e70(0x1f3),'params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':_0x148e70(0x21c),'version':_0x148e70(0x1ef)}}})});if(!_0x359971['ok']){let _0x5c68b9=await _0x359971['text']();return Y(_0x148e70(0x263)+_0x359971[_0x148e70(0x1e7)]+'\x20'+_0x5c68b9['slice'](0x0,0x64)),{'ok':!0x1,'error':_0x148e70(0x239)+_0x359971[_0x148e70(0x1e7)]};}await _0x359971[_0x148e70(0x21d)]();let _0x320e80=(await(await fetch(f+_0x148e70(0x220),{'method':_0x148e70(0x225),'headers':{'Content-Type':_0x148e70(0x1ec),'Accept':_0x148e70(0x1fc),...X?{'Authorization':_0x148e70(0x260)+X}:{}},'body':JSON[_0x148e70(0x206)]({'jsonrpc':_0x148e70(0x21b),'id':0x2,'method':'tools/call','params':{'name':_0x2ca91c,'arguments':_0x3d91a3}})}))[_0x148e70(0x21d)]())[_0x148e70(0x1f5)]('\x0a')[_0x148e70(0x204)](_0x1bd091=>_0x1bd091[_0x148e70(0x223)](_0x148e70(0x221)));if(_0x320e80){let _0x533f65=JSON['parse'](_0x320e80[_0x148e70(0x252)](0x6));return _0x533f65?.[_0x148e70(0x267)]?.['content']?.[0x0]?.[_0x148e70(0x21d)]?JSON[_0x148e70(0x238)](_0x533f65['result'][_0x148e70(0x26f)][0x0][_0x148e70(0x21d)]):_0x533f65;}return{'ok':!0x1,'error':'no\x20response'};}K['setRequestHandler'](a0_0x2eadca,async _0x3607fd=>{const _0x4a6fa7=a0_0x2e1510;let {name:_0x3d6d5e,arguments:_0x134181}=_0x3607fd['params'];if(_0x3d6d5e===_0x4a6fa7(0x242)){let {task_id:_0x307ff9,text:_0x51b5ef,status:_0x41fc93}=_0x134181;if(_0x41fc93==='completed'||_0x41fc93===_0x4a6fa7(0x25f)||_0x41fc93===_0x4a6fa7(0x20b)){let _0x317d17=_0x41fc93===_0x4a6fa7(0x22e)?_0x4a6fa7(0x240):_0x41fc93,_0x275754=_0x307ff9?k[_0x4a6fa7(0x216)](_0x307ff9)||'hub':_0x4a6fa7(0x212),_0x13aea6=await P(_0x4a6fa7(0x259),{'alias':_0x275754,'text':_0x51b5ef,'in_reply_to':_0x307ff9||void 0x0,'status':_0x317d17,'from_session':Z});if(_0x307ff9)k[_0x4a6fa7(0x269)](_0x307ff9);return{'content':[{'type':'text','text':JSON[_0x4a6fa7(0x206)](_0x13aea6)}]};}let _0xee553e=await P(_0x4a6fa7(0x1fe),{'resume_id':w,'alias':Z,'status':_0x41fc93===_0x4a6fa7(0x235)?'blocked':_0x41fc93===_0x4a6fa7(0x271)?_0x4a6fa7(0x271):'working','task':_0x51b5ef[_0x4a6fa7(0x252)](0x0,0xc8),'output':_0x51b5ef});return{'content':[{'type':_0x4a6fa7(0x21d),'text':JSON[_0x4a6fa7(0x206)](_0xee553e)}]};}if(_0x3d6d5e===_0x4a6fa7(0x210)){let {status:_0x414778,task:_0x3a82dc,progress:_0x56cf93}=_0x134181,_0x3d5420=await P(_0x4a6fa7(0x1fe),{'resume_id':w,'alias':Z,'status':_0x414778,'task':_0x3a82dc,'progress':_0x56cf93});return{'content':[{'type':_0x4a6fa7(0x21d),'text':JSON[_0x4a6fa7(0x206)](_0x3d5420)}]};}if(_0x3d6d5e===_0x4a6fa7(0x218)){let {alias:_0x2a9efc,task:_0x5de3bb,priority:_0x2fe922}=_0x134181,_0x3b44ee=await P(_0x4a6fa7(0x21a),{'alias':_0x2a9efc,'task':_0x5de3bb,'priority':_0x2fe922||'normal','from_session':Z});return{'content':[{'type':_0x4a6fa7(0x21d),'text':JSON[_0x4a6fa7(0x206)](_0x3b44ee)}]};}if(_0x3d6d5e==='commhub_send_message'){let {alias:_0x3b6f8f,message:_0x3fda8d}=_0x134181,_0x5ce08d=await P(_0x4a6fa7(0x241),{'alias':_0x3b6f8f,'message':_0x3fda8d,'from_session':Z});return{'content':[{'type':'text','text':JSON[_0x4a6fa7(0x206)](_0x5ce08d)}]};}if(_0x3d6d5e==='commhub_get_all_status'){let _0x5b03af=await P(_0x4a6fa7(0x233),{});return{'content':[{'type':_0x4a6fa7(0x21d),'text':JSON[_0x4a6fa7(0x206)](_0x5b03af)}]};}return{'content':[{'type':_0x4a6fa7(0x21d),'text':JSON[_0x4a6fa7(0x206)]({'error':_0x4a6fa7(0x1e9)})}]};});async function u(){const _0x55a925=a0_0x2e1510;let _0x4da42b=f+_0x55a925(0x1ff)+encodeURIComponent(Z),_0x2ce4c3={};if(X)_0x2ce4c3[_0x55a925(0x213)]=_0x55a925(0x260)+X;Y(_0x55a925(0x1f0)+_0x4da42b);while(!0x0){try{let _0x57df8e=await fetch(_0x4da42b,{'headers':_0x2ce4c3});if(!_0x57df8e['ok']){Y('SSE\x20error:\x20'+_0x57df8e[_0x55a925(0x1e7)]+'\x20'+_0x57df8e[_0x55a925(0x243)]),await h(0x1388);continue;}let _0x631817=_0x57df8e['body'][_0x55a925(0x249)](),_0x518a1b=new TextDecoder(),_0x424c54='';while(!0x0){let {done:_0x23e23d,value:_0x4324e6}=await _0x631817[_0x55a925(0x1f7)]();if(_0x23e23d)break;_0x424c54+=_0x518a1b[_0x55a925(0x227)](_0x4324e6,{'stream':!0x0});let _0x3330c7=_0x424c54[_0x55a925(0x1f5)]('\x0a\x0a');_0x424c54=_0x3330c7['pop']()||'';for(let _0x45160f of _0x3330c7){let _0x53c656=_0x45160f[_0x55a925(0x1f5)]('\x0a')[_0x55a925(0x204)](_0x9d137f=>_0x9d137f[_0x55a925(0x223)](_0x55a925(0x221)));if(!_0x53c656)continue;try{let _0x53bcc6=JSON[_0x55a925(0x238)](_0x53c656[_0x55a925(0x252)](0x6));await S(_0x53bcc6);}catch(_0x4f999a){Y(_0x55a925(0x25e)+_0x4f999a);}}}Y(_0x55a925(0x22a));}catch(_0x2147e9){Y(_0x55a925(0x1f9)+_0x2147e9);}await h(0xbb8);}}async function S(_0x41ca36){const _0x36f336=a0_0x2e1510;if(_0x41ca36[_0x36f336(0x1f1)]===_0x36f336(0x23a)){Y(_0x36f336(0x247)+Z+'\x22');return;}if(_0x41ca36['type']===_0x36f336(0x236)){if(Y(_0x36f336(0x25c)+_0x41ca36[_0x36f336(0x20c)]+':\x20'+_0x41ca36[_0x36f336(0x21f)][_0x36f336(0x252)](0x0,0x3c)),await K[_0x36f336(0x262)]({'method':_0x36f336(0x201),'params':{'content':_0x41ca36[_0x36f336(0x21f)],'meta':{'sender':_0x41ca36[_0x36f336(0x20c)]||_0x36f336(0x212),'sender_id':_0x36f336(0x24d),'user':_0x41ca36[_0x36f336(0x20c)]||_0x36f336(0x212),'priority':_0x36f336(0x24c)}}}),_0x41ca36['message_id'])await P(_0x36f336(0x251),{'alias':Z,'message_id':_0x41ca36[_0x36f336(0x261)]});return;}if(_0x41ca36[_0x36f336(0x1f1)]===_0x36f336(0x274)||_0x41ca36[_0x36f336(0x1f1)]===_0x36f336(0x214)){Y('←\x20'+_0x41ca36['type']+_0x36f336(0x200)+_0x41ca36['inbox_count']+_0x36f336(0x254)+(_0x41ca36[_0x36f336(0x23b)]||_0x36f336(0x24c)));let _0x117874=await P(_0x36f336(0x24f),{'alias':Z,'limit':0x5});if(_0x117874?.['ok']&&_0x117874[_0x36f336(0x23d)]?.[_0x36f336(0x26e)]>0x0)for(let _0x598ee1 of _0x117874['messages']){let _0x33318f={'sender':_0x598ee1[_0x36f336(0x211)]||_0x36f336(0x212),'sender_id':'commhub','user':_0x598ee1['from_session']||_0x36f336(0x212),'task_id':_0x598ee1['id'],'priority':_0x598ee1[_0x36f336(0x23b)]||_0x36f336(0x24c)};k[_0x36f336(0x248)](_0x598ee1['id'],_0x598ee1[_0x36f336(0x211)]||_0x36f336(0x212)),await K[_0x36f336(0x262)]({'method':_0x36f336(0x201),'params':{'content':_0x598ee1[_0x36f336(0x26f)],'meta':_0x33318f}}),Y(_0x36f336(0x22b)+_0x598ee1['id'][_0x36f336(0x252)](0x0,0x8)+_0x36f336(0x1f8)+_0x598ee1[_0x36f336(0x211)]+':\x20'+_0x598ee1[_0x36f336(0x26f)]['slice'](0x0,0x3c)),await P(_0x36f336(0x251),{'alias':Z,'message_id':_0x598ee1['id']});}}}async function A(){const _0x392693=a0_0x2e1510;let _0x42e23b=new a0_0x14ed2c();await K[_0x392693(0x1f2)](_0x42e23b),Y(_0x392693(0x232)),Y(_0x392693(0x23c)),u()[_0x392693(0x255)](_0x5f1fcf=>Y(_0x392693(0x257)+_0x5f1fcf)),P(_0x392693(0x1fe),{'resume_id':w,'alias':Z,'status':_0x392693(0x273),'server':a0_0x56c48a(),'hostname':a0_0x56c48a(),'agent':'claude-code','project_dir':process['cwd'](),'tmux_name':j||void 0x0})[_0x392693(0x25b)](()=>Y(_0x392693(0x1ea)+Z+_0x392693(0x1f4)+w['slice'](0x0,0x8)+')'))['catch'](_0x4e0c2d=>Y(_0x392693(0x226)+_0x4e0c2d)),setInterval(()=>{const _0x50bc99=_0x392693;P(_0x50bc99(0x1fe),{'resume_id':w,'alias':Z,'status':_0x50bc99(0x273),'server':a0_0x56c48a(),'hostname':a0_0x56c48a(),'agent':_0x50bc99(0x246),'project_dir':process['cwd'](),'tmux_name':j||void 0x0})['catch'](_0x5c4d40=>Y('heartbeat\x20failed:\x20'+_0x5c4d40));},0x2bf20),Y(_0x392693(0x237));}A()['catch'](_0x573f17=>{const _0x180e2b=a0_0x2e1510;Y('fatal:\x20'+_0x573f17),process[_0x180e2b(0x20e)](0x1);});async function N(){const _0x31e9aa=a0_0x2e1510;Y('shutting\x20down,\x20reporting\x20offline...'),await P(_0x31e9aa(0x1fe),{'resume_id':w,'alias':Z,'status':_0x31e9aa(0x271),'task':_0x31e9aa(0x202)})[_0x31e9aa(0x255)](()=>{}),process[_0x31e9aa(0x20e)](0x0);}process[a0_0x2e1510(0x245)]['on']('end',()=>N()),process['on'](a0_0x2e1510(0x1fb),()=>N()),process['on']('SIGINT',()=>N());
2
+ const a0_0x25dfde=a0_0x3fd2;(function(_0x4498cc,_0x3a4f7b){const _0x5678fa=a0_0x3fd2,_0x1d73c1=_0x4498cc();while(!![]){try{const _0x36a927=-parseInt(_0x5678fa(0x202))/0x1+-parseInt(_0x5678fa(0x21d))/0x2+-parseInt(_0x5678fa(0x1fc))/0x3*(-parseInt(_0x5678fa(0x1ab))/0x4)+parseInt(_0x5678fa(0x1c9))/0x5+parseInt(_0x5678fa(0x1d8))/0x6*(-parseInt(_0x5678fa(0x1fb))/0x7)+parseInt(_0x5678fa(0x1e3))/0x8*(-parseInt(_0x5678fa(0x1f0))/0x9)+-parseInt(_0x5678fa(0x1e4))/0xa*(-parseInt(_0x5678fa(0x206))/0xb);if(_0x36a927===_0x3a4f7b)break;else _0x1d73c1['push'](_0x1d73c1['shift']());}catch(_0xea83b6){_0x1d73c1['push'](_0x1d73c1['shift']());}}}(a0_0x1e82,0x41d34));import{readFileSync as a0_0x203088,existsSync as a0_0x1513b2}from'fs';import{randomUUID as a0_0x570c79}from'crypto';import{join as a0_0x38a70a}from'path';import{hostname as a0_0x3c71c3}from'os';import{execSync as a0_0x254f69}from'child_process';import{Server as a0_0x75a7d3}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x518a86}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x3b60c6,CallToolRequestSchema as a0_0x1e6d82}from'@modelcontextprotocol/sdk/types.js';function p(_0x1a4792){const _0x4677ae=a0_0x3fd2;if(!a0_0x1513b2(_0x1a4792))return;for(let _0x54b877 of a0_0x203088(_0x1a4792,'utf-8')['split']('\x0a')){let _0x11ec3e=_0x54b877['trim']();if(!_0x11ec3e||_0x11ec3e[_0x4677ae(0x219)]('#'))continue;let _0x39589e=_0x11ec3e[_0x4677ae(0x1c4)]('=');if(_0x39589e<0x0)continue;let _0x459bf7=_0x11ec3e[_0x4677ae(0x209)](0x0,_0x39589e)[_0x4677ae(0x1b9)](),_0x3163a=_0x11ec3e[_0x4677ae(0x209)](_0x39589e+0x1)[_0x4677ae(0x1b9)]()[_0x4677ae(0x1f1)](/^["']|["']$/g,'');if(!process.env[_0x459bf7])process.env[_0x459bf7]=_0x3163a;}}var C=process.env.HOME||'~',T=a0_0x38a70a(C,a0_0x25dfde(0x1e7));p(a0_0x38a70a(T,a0_0x25dfde(0x1eb)));var L=process['cwd']()[a0_0x25dfde(0x1f1)](/\//g,'-');p(a0_0x38a70a(T,L,a0_0x25dfde(0x1eb)));function U(){const _0x358a3e=a0_0x25dfde;try{return a0_0x254f69('tmux\x20display-message\x20-p\x20\x27#S\x27',{'encoding':_0x358a3e(0x20a),'timeout':0x7d0})[_0x358a3e(0x1b9)]();}catch{return'';}}function v(){const _0x106490=a0_0x25dfde;try{let _0x51a9c1=a0_0x38a70a(C,_0x106490(0x208),_0x106490(0x217));if(a0_0x1513b2(_0x51a9c1))return JSON[_0x106490(0x1be)](a0_0x203088(_0x51a9c1,_0x106490(0x20a)));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x25dfde(0x22a)]||a0_0x25dfde(0x1f5),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x3c71c3(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x570c79(),X=process.env.COMMHUB_TOKEN||H[a0_0x25dfde(0x1f6)]||'';function Y(_0x54d82b){const _0x3e6fb4=a0_0x25dfde;let _0x3c3fc1=new Date()[_0x3e6fb4(0x1bc)]()['slice'](0x0,0x8);process[_0x3e6fb4(0x1dd)][_0x3e6fb4(0x1bf)]('['+_0x3c3fc1+']\x20[commhub]\x20'+_0x54d82b+'\x0a');}function h(_0x580c47){return new Promise(_0x1a2743=>setTimeout(_0x1a2743,_0x580c47));}Y('ENV:\x20URL='+f+a0_0x25dfde(0x1d0)+Z+a0_0x25dfde(0x210)+w['slice'](0x0,0x8)+'...\x20TMUX='+(j||a0_0x25dfde(0x1ae))+'\x20CWD='+process[a0_0x25dfde(0x1bd)]()+'\x20PROJECT_ENV='+L);var k=new Map(),K=new a0_0x75a7d3({'name':'commhub-channel','version':a0_0x25dfde(0x1e0)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x25dfde(0x22b),a0_0x25dfde(0x1c1),'Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.',a0_0x25dfde(0x213),a0_0x25dfde(0x224)+Z][a0_0x25dfde(0x1ec)]('\x0a')});function a0_0x3fd2(_0x1d98b4,_0x57e953){_0x1d98b4=_0x1d98b4-0x1a6;const _0x1e82d5=a0_0x1e82();let _0x3fd218=_0x1e82d5[_0x1d98b4];return _0x3fd218;}K['setRequestHandler'](a0_0x3b60c6,async()=>({'tools':[{'name':a0_0x25dfde(0x228),'description':a0_0x25dfde(0x1f3),'inputSchema':{'type':'object','properties':{'task_id':{'type':a0_0x25dfde(0x1ee),'description':'The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)'},'text':{'type':a0_0x25dfde(0x1ee),'description':a0_0x25dfde(0x1ed)},'status':{'type':a0_0x25dfde(0x1ee),'enum':[a0_0x25dfde(0x21c),a0_0x25dfde(0x205),a0_0x25dfde(0x22f),'blocked',a0_0x25dfde(0x1b0),'in_progress'],'description':a0_0x25dfde(0x225)}},'required':['text']}},{'name':a0_0x25dfde(0x1cf),'description':a0_0x25dfde(0x1c0),'inputSchema':{'type':a0_0x25dfde(0x1c6),'properties':{'status':{'type':a0_0x25dfde(0x1ee),'enum':['working',a0_0x25dfde(0x1d2),a0_0x25dfde(0x1fa),a0_0x25dfde(0x1b0)]},'task':{'type':'string','description':'Current\x20task\x20description'},'progress':{'type':a0_0x25dfde(0x1b3),'description':a0_0x25dfde(0x21a)}},'required':[a0_0x25dfde(0x1ea)]}},{'name':a0_0x25dfde(0x1d6),'description':'Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','inputSchema':{'type':a0_0x25dfde(0x1c6),'properties':{'alias':{'type':a0_0x25dfde(0x1ee),'description':a0_0x25dfde(0x1af)},'task':{'type':a0_0x25dfde(0x1ee),'description':'Task\x20content'},'priority':{'type':a0_0x25dfde(0x1ee),'enum':[a0_0x25dfde(0x1ca),a0_0x25dfde(0x201),a0_0x25dfde(0x221)],'description':a0_0x25dfde(0x1d3)}},'required':[a0_0x25dfde(0x1de),a0_0x25dfde(0x226)]}},{'name':'commhub_send_message','description':'Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','inputSchema':{'type':a0_0x25dfde(0x1c6),'properties':{'alias':{'type':'string','description':a0_0x25dfde(0x1af)},'message':{'type':a0_0x25dfde(0x1ee),'description':a0_0x25dfde(0x1a6)}},'required':[a0_0x25dfde(0x1de),a0_0x25dfde(0x1f7)]}},{'name':a0_0x25dfde(0x215),'description':a0_0x25dfde(0x1d7),'inputSchema':{'type':'object','properties':{}}}]}));async function P(_0x38088f,_0x4467c0){const _0x384c2e=a0_0x25dfde;let _0xdffd1b=await fetch(f+_0x384c2e(0x1ad),{'method':_0x384c2e(0x1d1),'headers':{'Content-Type':_0x384c2e(0x207),'Accept':_0x384c2e(0x1e9),...X?{'Authorization':_0x384c2e(0x1ff)+X}:{}},'body':JSON['stringify']({'jsonrpc':_0x384c2e(0x1d5),'id':0x1,'method':_0x384c2e(0x223),'params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':_0x384c2e(0x1f4),'version':_0x384c2e(0x1e0)}}})});if(!_0xdffd1b['ok']){let _0x4f3b73=await _0xdffd1b[_0x384c2e(0x21b)]();return Y('CommHub\x20init\x20failed:\x20'+_0xdffd1b[_0x384c2e(0x1ea)]+'\x20'+_0x4f3b73[_0x384c2e(0x209)](0x0,0x64)),{'ok':!0x1,'error':_0x384c2e(0x1c8)+_0xdffd1b[_0x384c2e(0x1ea)]};}await _0xdffd1b[_0x384c2e(0x21b)]();let _0x52f353=(await(await fetch(f+_0x384c2e(0x1ad),{'method':_0x384c2e(0x1d1),'headers':{'Content-Type':'application/json','Accept':'application/json,\x20text/event-stream',...X?{'Authorization':'Bearer\x20'+X}:{}},'body':JSON[_0x384c2e(0x21f)]({'jsonrpc':_0x384c2e(0x1d5),'id':0x2,'method':_0x384c2e(0x203),'params':{'name':_0x38088f,'arguments':_0x4467c0}})}))[_0x384c2e(0x21b)]())['split']('\x0a')[_0x384c2e(0x1db)](_0x3a3b2d=>_0x3a3b2d[_0x384c2e(0x219)]('data:\x20'));if(_0x52f353){let _0x10542d=JSON['parse'](_0x52f353[_0x384c2e(0x209)](0x6));return _0x10542d?.[_0x384c2e(0x1f2)]?.['content']?.[0x0]?.[_0x384c2e(0x21b)]?JSON[_0x384c2e(0x1be)](_0x10542d[_0x384c2e(0x1f2)][_0x384c2e(0x1b4)][0x0][_0x384c2e(0x21b)]):_0x10542d;}return{'ok':!0x1,'error':_0x384c2e(0x1ef)};}K[a0_0x25dfde(0x1e8)](a0_0x1e6d82,async _0xd68c57=>{const _0x2416a8=a0_0x25dfde;let {name:_0x37ce67,arguments:_0x22538b}=_0xd68c57['params'];if(_0x37ce67===_0x2416a8(0x228)){let {task_id:_0x26fd5e,text:_0x5f3fbd,status:_0x509a61}=_0x22538b;if(_0x509a61===_0x2416a8(0x21c)||_0x509a61==='failed'||_0x509a61===_0x2416a8(0x22f)){let _0xb1c103=_0x509a61===_0x2416a8(0x21c)?'replied':_0x509a61,_0x310d99=_0x26fd5e?k[_0x2416a8(0x218)](_0x26fd5e)||_0x2416a8(0x22a):_0x2416a8(0x22a),_0x214bdc=await P(_0x2416a8(0x1c3),{'alias':_0x310d99,'text':_0x5f3fbd,'in_reply_to':_0x26fd5e||void 0x0,'status':_0xb1c103,'from_session':Z});if(_0x26fd5e)k[_0x2416a8(0x20d)](_0x26fd5e);return{'content':[{'type':_0x2416a8(0x21b),'text':JSON[_0x2416a8(0x21f)](_0x214bdc)}]};}let _0x42a78c=await P(_0x2416a8(0x21e),{'resume_id':w,'alias':Z,'status':_0x509a61===_0x2416a8(0x1fa)?_0x2416a8(0x1fa):_0x509a61===_0x2416a8(0x1b0)?_0x2416a8(0x1b0):_0x2416a8(0x1e6),'task':_0x5f3fbd[_0x2416a8(0x209)](0x0,0xc8),'output':_0x5f3fbd});return{'content':[{'type':_0x2416a8(0x21b),'text':JSON['stringify'](_0x42a78c)}]};}if(_0x37ce67===_0x2416a8(0x1cf)){let {status:_0x208716,task:_0x4e394b,progress:_0x44724b}=_0x22538b,_0x3b2c20=await P('report_status',{'resume_id':w,'alias':Z,'status':_0x208716,'task':_0x4e394b,'progress':_0x44724b});return{'content':[{'type':_0x2416a8(0x21b),'text':JSON[_0x2416a8(0x21f)](_0x3b2c20)}]};}if(_0x37ce67===_0x2416a8(0x1d6)){let {alias:_0x3d6fa0,task:_0x56daa0,priority:_0x399ff4}=_0x22538b,_0x16cfc6=await P('send_task',{'alias':_0x3d6fa0,'task':_0x56daa0,'priority':_0x399ff4||_0x2416a8(0x201),'from_session':Z});return{'content':[{'type':'text','text':JSON[_0x2416a8(0x21f)](_0x16cfc6)}]};}if(_0x37ce67==='commhub_send_message'){let {alias:_0x49f59b,message:_0x15c1cd}=_0x22538b,_0x4e55ff=await P(_0x2416a8(0x222),{'alias':_0x49f59b,'message':_0x15c1cd,'from_session':Z});return{'content':[{'type':_0x2416a8(0x21b),'text':JSON[_0x2416a8(0x21f)](_0x4e55ff)}]};}if(_0x37ce67===_0x2416a8(0x215)){let _0x1b5f33=await P(_0x2416a8(0x1ce),{});return{'content':[{'type':_0x2416a8(0x21b),'text':JSON[_0x2416a8(0x21f)](_0x1b5f33)}]};}return{'content':[{'type':_0x2416a8(0x21b),'text':JSON[_0x2416a8(0x21f)]({'error':_0x2416a8(0x1c7)})}]};});async function u(){const _0x4afda8=a0_0x25dfde;let _0x3e025f=f+_0x4afda8(0x214)+encodeURIComponent(Z),_0xd7066f={};if(X)_0xd7066f[_0x4afda8(0x1cc)]=_0x4afda8(0x1ff)+X;Y('connecting\x20to\x20'+_0x3e025f);while(!0x0){try{let _0x227286=await fetch(_0x3e025f,{'headers':_0xd7066f});if(!_0x227286['ok']){Y(_0x4afda8(0x1b5)+_0x227286[_0x4afda8(0x1ea)]+'\x20'+_0x227286[_0x4afda8(0x20e)]),await h(0x1388);continue;}let _0xf8a7b=_0x227286[_0x4afda8(0x20c)][_0x4afda8(0x1f8)](),_0x5429c4=new TextDecoder(),_0x514f7d='';while(!0x0){let {done:_0x2ef86c,value:_0x33a48a}=await _0xf8a7b[_0x4afda8(0x22e)]();if(_0x2ef86c)break;_0x514f7d+=_0x5429c4['decode'](_0x33a48a,{'stream':!0x0});let _0x3a4dea=_0x514f7d['split']('\x0a\x0a');_0x514f7d=_0x3a4dea[_0x4afda8(0x216)]()||'';for(let _0x3a5f5a of _0x3a4dea){let _0x32f715=_0x3a5f5a[_0x4afda8(0x1e2)]('\x0a')[_0x4afda8(0x1db)](_0x7e990a=>_0x7e990a['startsWith'](_0x4afda8(0x220)));if(!_0x32f715)continue;try{let _0x177972=JSON[_0x4afda8(0x1be)](_0x32f715[_0x4afda8(0x209)](0x6));await S(_0x177972);}catch(_0x19250c){Y(_0x4afda8(0x1a7)+_0x19250c);}}}Y('SSE\x20stream\x20ended,\x20reconnecting...');}catch(_0x543d55){Y('SSE\x20connection\x20error:\x20'+_0x543d55);}await h(0xbb8);}}async function S(_0x4660d6){const _0x319077=a0_0x25dfde;if(_0x4660d6[_0x319077(0x1f9)]===_0x319077(0x1ba)){Y(_0x319077(0x227)+Z+'\x22');return;}if(_0x4660d6[_0x319077(0x1f9)]===_0x319077(0x1fe)){if(Y('←\x20message\x20from\x20'+_0x4660d6[_0x319077(0x1b1)]+':\x20'+_0x4660d6['message'][_0x319077(0x209)](0x0,0x3c)),await K[_0x319077(0x20f)]({'method':_0x319077(0x1c5),'params':{'content':_0x4660d6[_0x319077(0x1f7)],'meta':{'sender':_0x4660d6[_0x319077(0x1b1)]||_0x319077(0x22a),'sender_id':_0x319077(0x1aa),'user':_0x4660d6[_0x319077(0x1b1)]||_0x319077(0x22a),'priority':'normal'}}}),_0x4660d6[_0x319077(0x1b8)])await P(_0x319077(0x22c),{'alias':Z,'message_id':_0x4660d6['message_id']});return;}if(_0x4660d6[_0x319077(0x1f9)]===_0x319077(0x1a8)||_0x4660d6[_0x319077(0x1f9)]==='broadcast'){Y('←\x20'+_0x4660d6[_0x319077(0x1f9)]+_0x319077(0x1ac)+_0x4660d6[_0x319077(0x200)]+'\x20priority='+(_0x4660d6[_0x319077(0x1d9)]||_0x319077(0x201)));let _0x41af7e=await P('get_inbox',{'alias':Z,'limit':0x5});if(_0x41af7e?.['ok']&&_0x41af7e[_0x319077(0x1df)]?.[_0x319077(0x204)]>0x0)for(let _0x3dabee of _0x41af7e[_0x319077(0x1df)]){let _0x2012dd={'sender':_0x3dabee[_0x319077(0x20b)]||_0x319077(0x22a),'sender_id':_0x319077(0x1aa),'user':_0x3dabee[_0x319077(0x20b)]||_0x319077(0x22a),'task_id':_0x3dabee['id'],'priority':_0x3dabee[_0x319077(0x1d9)]||_0x319077(0x201)};k[_0x319077(0x1a9)](_0x3dabee['id'],_0x3dabee['from_session']||_0x319077(0x22a)),await K['notification']({'method':_0x319077(0x1c5),'params':{'content':_0x3dabee[_0x319077(0x1b4)],'meta':_0x2012dd}}),Y('→\x20injected\x20task\x20'+_0x3dabee['id']['slice'](0x0,0x8)+_0x319077(0x1b2)+_0x3dabee[_0x319077(0x20b)]+':\x20'+_0x3dabee[_0x319077(0x1b4)]['slice'](0x0,0x3c)),await P('ack_inbox',{'alias':Z,'message_id':_0x3dabee['id']});}}}function a0_0x1e82(){const _0xd9294b=['Authorization','shutting\x20down,\x20reporting\x20offline...','get_all_status','commhub_report_status','\x20ALIAS=','POST','idle','Priority\x20(default:\x20normal)','claude-code','2.0','commhub_send_task','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','6lqiIRY','priority','fatal:\x20','find','starting\x20SSE\x20listener...','stderr','alias','messages','0.3.0','registered\x20as\x20\x22','split','14104EJNLvm','3070OIVJbn','\x22\x20(','working','.claude/channels/commhub','setRequestHandler','application/json,\x20text/event-stream','status','.env','join','Reply\x20text\x20/\x20result\x20summary','string','no\x20response','207FmaUXT','replace','result','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','commhub-channel','http://127.0.0.1:9200','token','message','getReader','type','blocked','1278956UPugtK','3UWAlbe','end','new_message','Bearer\x20','inbox_count','normal','287949abrPDg','tools/call','length','failed','38511XukqnD','application/json','.anet','slice','utf-8','from_session','body','delete','statusText','notification','\x20RESUME_ID=','offline','exit','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','/events/','commhub_get_all_status','pop','config.json','get','startsWith','Progress\x200-100','text','completed','850936gyKaeP','report_status','stringify','data:\x20','low','send_message','initialize','Session\x20alias:\x20','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','task','SSE\x20connected\x20as\x20\x22','commhub_reply','heartbeat\x20failed:\x20','hub','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','ack_inbox','warning:\x20could\x20not\x20register:\x20','read','cancelled','Message\x20content','parse\x20error:\x20','new_task','set','commhub','75524CBrNww',':\x20inbox_count=','/mcp','none','Target\x20session\x20alias','error','from','\x20from\x20','number','content','SSE\x20error:\x20','SIGINT','catch','message_id','trim','connected','connect','toTimeString','cwd','parse','write','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','then','send_reply','indexOf','notifications/claude/channel','object','unknown\x20tool','init\x20failed:\x20','563030GPVrnz','high','ready\x20—\x20waiting\x20for\x20events'];a0_0x1e82=function(){return _0xd9294b;};return a0_0x1e82();}async function A(){const _0x1eeb74=a0_0x25dfde;let _0xf1112f=new a0_0x518a86();await K[_0x1eeb74(0x1bb)](_0xf1112f),Y('MCP\x20stdio\x20connected'),Y(_0x1eeb74(0x1dc)),u()[_0x1eeb74(0x1b7)](_0x450905=>Y('SSE\x20fatal:\x20'+_0x450905)),P(_0x1eeb74(0x21e),{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x3c71c3(),'hostname':a0_0x3c71c3(),'agent':_0x1eeb74(0x1d4),'project_dir':process['cwd'](),'tmux_name':j||void 0x0})[_0x1eeb74(0x1c2)](()=>Y(_0x1eeb74(0x1e1)+Z+_0x1eeb74(0x1e5)+w[_0x1eeb74(0x209)](0x0,0x8)+')'))[_0x1eeb74(0x1b7)](_0x42eacb=>Y(_0x1eeb74(0x22d)+_0x42eacb)),setInterval(()=>{const _0x1a9ccc=_0x1eeb74;P(_0x1a9ccc(0x21e),{'resume_id':w,'alias':Z,'status':_0x1a9ccc(0x1d2),'server':a0_0x3c71c3(),'hostname':a0_0x3c71c3(),'agent':'claude-code','project_dir':process[_0x1a9ccc(0x1bd)](),'tmux_name':j||void 0x0})['catch'](_0x478a48=>Y(_0x1a9ccc(0x229)+_0x478a48));},0x2bf20),Y(_0x1eeb74(0x1cb));}A()['catch'](_0x44df27=>{const _0x29b611=a0_0x25dfde;Y(_0x29b611(0x1da)+_0x44df27),process[_0x29b611(0x212)](0x1);});async function N(){const _0x25c2d0=a0_0x25dfde;Y(_0x25c2d0(0x1cd)),await P('report_status',{'resume_id':w,'alias':Z,'status':_0x25c2d0(0x211),'task':'session\x20disconnected'})['catch'](()=>{}),process[_0x25c2d0(0x212)](0x0);}process['stdin']['on'](a0_0x25dfde(0x1fd),()=>N()),process['on']('SIGTERM',()=>N()),process['on'](a0_0x25dfde(0x1b6),()=>N());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.2.7-preview.1",
3
+ "version": "2.2.7-preview.3",
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",