@sleep2agi/agent-network 2.3.0-preview.10 → 2.3.0-preview.13
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.
- package/dist/bin/cli.js +1 -1
- package/dist/src/client.js +1 -1
- package/dist/src/im/feishu/worker.js +1 -1
- package/dist/src/node-server.js +1 -1
- package/package.json +1 -1
package/dist/src/client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a0_0xf1c06c=a0_0x2fb6;(function(_0x24f5d0,_0x46255b){const _0x55a99b=a0_0x2fb6,_0x3a2bc6=_0x24f5d0();while(!![]){try{const _0x44d267=parseInt(_0x55a99b(0x1b3))/0x1+-parseInt(_0x55a99b(0x1da))/0x2*(parseInt(_0x55a99b(0x205))/0x3)+parseInt(_0x55a99b(0x1d8))/0x4*(-parseInt(_0x55a99b(0x1d0))/0x5)+-parseInt(_0x55a99b(0x1e3))/0x6*(-parseInt(_0x55a99b(0x1e6))/0x7)+parseInt(_0x55a99b(0x1f4))/0x8*(-parseInt(_0x55a99b(0x1eb))/0x9)+-parseInt(_0x55a99b(0x203))/0xa*(-parseInt(_0x55a99b(0x1c1))/0xb)+parseInt(_0x55a99b(0x1b6))/0xc*(-parseInt(_0x55a99b(0x1f6))/0xd);if(_0x44d267===_0x46255b)break;else _0x3a2bc6['push'](_0x3a2bc6['shift']());}catch(_0x45778e){_0x3a2bc6['push'](_0x3a2bc6['shift']());}}}(a0_0x10c1,0xee739));import{EventEmitter as a0_0x1aefac}from'events';import{hostname as a0_0x9816c1}from'os';class T extends a0_0x1aefac{[a0_0xf1c06c(0x208)];[a0_0xf1c06c(0x1cd)];[a0_0xf1c06c(0x1f2)];[a0_0xf1c06c(0x1d1)];[a0_0xf1c06c(0x1f1)];[a0_0xf1c06c(0x1c2)];[a0_0xf1c06c(0x1d5)];['heartbeatTimer'];[a0_0xf1c06c(0x1d4)];['running']=!0x1;constructor(_0xa28ffe){const _0x2f4640=a0_0xf1c06c;super();if(this[_0x2f4640(0x208)]=_0xa28ffe[_0x2f4640(0x208)][_0x2f4640(0x1bf)](/\/$/,''),this[_0x2f4640(0x1cd)]=_0xa28ffe[_0x2f4640(0x1cd)],this['token']=_0xa28ffe[_0x2f4640(0x1f2)],this[_0x2f4640(0x1d1)]=_0xa28ffe[_0x2f4640(0x1d1)]||_0x2f4640(0x1ba),this['resumeId']=_0x2f4640(0x1ca)+_0xa28ffe[_0x2f4640(0x1cd)]+'-'+Date['now']()[_0x2f4640(0x1f3)](0x24),this[_0x2f4640(0x1c2)]=_0xa28ffe[_0x2f4640(0x1c2)]??0x2bf20,this[_0x2f4640(0x1d5)]=_0xa28ffe['reconnectDelay']??0xbb8,_0xa28ffe[_0x2f4640(0x1f7)]!==!0x1)this['connect']();}[a0_0xf1c06c(0x1ef)](_0x5514ed){const _0x40161b=a0_0xf1c06c;console['log']('['+new Date()[_0x40161b(0x1de)]()[_0x40161b(0x1fc)](0x0,0x8)+_0x40161b(0x1fa)+this[_0x40161b(0x1cd)]+']\x20'+_0x5514ed);}async['call'](_0x435db5,_0xb0bcfc){const _0x566ce9=a0_0xf1c06c;let _0xa14dce={'Content-Type':_0x566ce9(0x1c0),'Accept':'application/json,\x20text/event-stream'};if(this[_0x566ce9(0x1f2)])_0xa14dce[_0x566ce9(0x1bd)]=_0x566ce9(0x1df)+this['token'];let _0x5f0e8c=await(await fetch(this[_0x566ce9(0x208)]+_0x566ce9(0x1c7),{'method':'POST','headers':_0xa14dce,'body':JSON['stringify']({'jsonrpc':_0x566ce9(0x20c),'id':Date['now'](),'method':_0x566ce9(0x1ce),'params':{'name':_0x435db5,'arguments':_0xb0bcfc}})}))[_0x566ce9(0x1cf)](),_0x1fd6ff=_0x5f0e8c[_0x566ce9(0x1c3)](/data: (.+)/),_0x32c202=_0x1fd6ff?JSON['parse'](_0x1fd6ff[0x1]):JSON[_0x566ce9(0x209)](_0x5f0e8c),_0x1569a9=_0x32c202?.[_0x566ce9(0x1c8)]?.['content']?.[0x0]?.[_0x566ce9(0x1cf)];return _0x1569a9?JSON['parse'](_0x1569a9):_0x32c202;}async['connect'](){const _0x63b9df=a0_0xf1c06c;if(this['running'])return;this[_0x63b9df(0x1bc)]=!0x0,await this[_0x63b9df(0x1dd)]('idle'),this[_0x63b9df(0x1ef)](_0x63b9df(0x1ed)),this[_0x63b9df(0x1b8)]=setInterval(()=>{const _0x4bb546=_0x63b9df;this[_0x4bb546(0x1dd)](_0x4bb546(0x1fe))[_0x4bb546(0x1b7)](_0x3c7c19=>this[_0x4bb546(0x1ef)](_0x4bb546(0x1c6)+_0x3c7c19['message']));},this[_0x63b9df(0x1c2)]),this['connectSSE']();}async[a0_0xf1c06c(0x206)](){const _0xf8a9e9=a0_0xf1c06c;if(this[_0xf8a9e9(0x1bc)]=!0x1,this[_0xf8a9e9(0x1d4)]?.['abort'](),this[_0xf8a9e9(0x1b8)])clearInterval(this[_0xf8a9e9(0x1b8)]);await this[_0xf8a9e9(0x1dd)](_0xf8a9e9(0x201))[_0xf8a9e9(0x1b7)](()=>{}),this[_0xf8a9e9(0x1ef)](_0xf8a9e9(0x1f5));}async['send'](_0x5799b8,_0xb54cb0,_0x24ed41=a0_0xf1c06c(0x207)){const _0x1e3a77=a0_0xf1c06c;return this[_0x1e3a77(0x1f8)]('send_task',{'alias':_0x5799b8,'task':_0xb54cb0,'priority':_0x24ed41,'from_session':this[_0x1e3a77(0x1cd)]});}async[a0_0xf1c06c(0x1cc)](_0x4bdfb4,_0x52ff34){const _0x2b341d=a0_0xf1c06c;return this[_0x2b341d(0x1f8)](_0x2b341d(0x1cb),{'alias':_0x4bdfb4,'message':_0x52ff34,'from_session':this[_0x2b341d(0x1cd)]});}async[a0_0xf1c06c(0x1ff)](_0x3c83d9,_0x5a06ec,_0xc8aa36=a0_0xf1c06c(0x1ec)){const _0x188c2b=a0_0xf1c06c;return this[_0x188c2b(0x1f8)](_0x188c2b(0x1c5),{'in_reply_to':_0x3c83d9,'text':_0x5a06ec,'status':_0xc8aa36});}async['status'](_0x53a109,_0x37edbd){const _0x1091ea=a0_0xf1c06c;return this['call'](_0x1091ea(0x202),{'resume_id':this[_0x1091ea(0x1f1)],'alias':this[_0x1091ea(0x1cd)],'status':_0x53a109,'server':a0_0x9816c1(),'hostname':a0_0x9816c1(),'agent':this[_0x1091ea(0x1d1)],'project_dir':process['cwd'](),..._0x37edbd});}async['getAllStatus'](){const _0x472c60=a0_0xf1c06c;return this[_0x472c60(0x1f8)](_0x472c60(0x1d6),{});}async[a0_0xf1c06c(0x1d3)](_0x59bff9,_0xc555a9){const _0x2bf5d0=a0_0xf1c06c;return this[_0x2bf5d0(0x1f8)]('broadcast',{'message':_0x59bff9,'filter_server':_0xc555a9?.['server'],'filter_status':_0xc555a9?.['status']});}async[a0_0xf1c06c(0x1e2)](){const _0x1c67a8=a0_0xf1c06c;let _0x5c0588=encodeURIComponent(this[_0x1c67a8(0x1cd)]),_0x26c11b=this['url']+_0x1c67a8(0x200)+_0x5c0588,_0x3e5be0=this[_0x1c67a8(0x1d5)];while(this[_0x1c67a8(0x1bc)]){try{this[_0x1c67a8(0x1d4)]=new AbortController();let _0x5dac57={'Accept':_0x1c67a8(0x1e1)};if(this['token'])_0x5dac57[_0x1c67a8(0x1bd)]=_0x1c67a8(0x1df)+this[_0x1c67a8(0x1f2)];let _0x3a096f=await fetch(_0x26c11b,{'headers':_0x5dac57,'signal':this[_0x1c67a8(0x1d4)][_0x1c67a8(0x1ee)]});if(!_0x3a096f['ok']||!_0x3a096f[_0x1c67a8(0x1c4)]){this['log'](_0x1c67a8(0x204)+_0x3a096f[_0x1c67a8(0x1dd)]),await this['sleep'](_0x3e5be0),_0x3e5be0=Math[_0x1c67a8(0x1e5)](_0x3e5be0*1.5,0xea60);continue;}_0x3e5be0=this[_0x1c67a8(0x1d5)];let _0x297609=_0x3a096f[_0x1c67a8(0x1c4)][_0x1c67a8(0x1b9)](),_0x3c4588=new TextDecoder(),_0x371de5='';while(this[_0x1c67a8(0x1bc)]){let {done:_0x38b805,value:_0x23dbec}=await _0x297609[_0x1c67a8(0x1e0)]();if(_0x38b805)break;_0x371de5+=_0x3c4588[_0x1c67a8(0x1f9)](_0x23dbec,{'stream':!0x0});let _0x39d447=_0x371de5[_0x1c67a8(0x1fd)]('\x0a');_0x371de5=_0x39d447['pop']()||'';for(let _0x16a83e of _0x39d447){if(!_0x16a83e['startsWith'](_0x1c67a8(0x1c9)))continue;try{let _0x4ba2c1=JSON[_0x1c67a8(0x209)](_0x16a83e[_0x1c67a8(0x1fc)](0x6));if(_0x4ba2c1[_0x1c67a8(0x1fb)]==='connected'){this['log'](_0x1c67a8(0x1f0)),this[_0x1c67a8(0x20d)](_0x1c67a8(0x1bb));continue;}if(_0x4ba2c1[_0x1c67a8(0x1fb)]===_0x1c67a8(0x1d7)||_0x4ba2c1[_0x1c67a8(0x1fb)]===_0x1c67a8(0x1e9)||_0x4ba2c1[_0x1c67a8(0x1fb)]===_0x1c67a8(0x1d3))await this[_0x1c67a8(0x20a)]();}catch{}}}}catch(_0x40632e){if(_0x40632e['name']===_0x1c67a8(0x1db))break;this['emit'](_0x1c67a8(0x1b4),_0x40632e),this['log'](_0x1c67a8(0x1dc)+_0x40632e[_0x1c67a8(0x1cc)]);}if(this[_0x1c67a8(0x1bc)])this[_0x1c67a8(0x20d)](_0x1c67a8(0x1f5)),this[_0x1c67a8(0x1ef)](_0x1c67a8(0x1d9)+_0x3e5be0/0x3e8+_0x1c67a8(0x1e7)),await this[_0x1c67a8(0x1e4)](_0x3e5be0),_0x3e5be0=Math['min'](_0x3e5be0*1.5,0xea60);}}async[a0_0xf1c06c(0x20a)](){const _0xc52ce6=a0_0xf1c06c;try{let _0x2515a3=(await this['call'](_0xc52ce6(0x20b),{'alias':this[_0xc52ce6(0x1cd)],'limit':0xa}))?.[_0xc52ce6(0x1be)]||[];for(let _0x334a8d of _0x2515a3)await this['call'](_0xc52ce6(0x1d2),{'alias':this[_0xc52ce6(0x1cd)],'message_id':_0x334a8d['id']}),this[_0xc52ce6(0x1ef)]('←\x20'+_0x334a8d[_0xc52ce6(0x1e8)]+':\x20'+_0x334a8d['content']['slice'](0x0,0x3c)),this[_0xc52ce6(0x20d)](_0xc52ce6(0x1b5),_0x334a8d),this['emit'](_0xc52ce6(0x1cc),_0x334a8d);}catch(_0x4aadd2){this['log'](_0xc52ce6(0x1ea)+_0x4aadd2[_0xc52ce6(0x1cc)]);}}[a0_0xf1c06c(0x1e4)](_0x1b31d3){return new Promise(_0x3661e1=>setTimeout(_0x3661e1,_0x1b31d3));}}function a0_0x2fb6(_0x13ed3c,_0x1f9da5){_0x13ed3c=_0x13ed3c-0x1b3;const _0x10c166=a0_0x10c1();let _0x2fb6e8=_0x10c166[_0x13ed3c];return _0x2fb6e8;}function a0_0x10c1(){const _0x509aab=['log','SSE\x20connected','resumeId','token','toString','24856cExImL','disconnected','117EeDmKL','autoConnect','call','decode',']\x20[commhub:','type','slice','split','idle','reply','/events/','offline','report_status','20whfLXo','SSE\x20failed:\x20','104724ZLoDSu','disconnect','normal','url','parse','processInbox','get_inbox','2.0','emit','1830591SdfYRp','error','task','716712GJYvvZ','catch','heartbeatTimer','getReader','sdk','connected','running','Authorization','messages','replace','application/json','3402487xYzowj','heartbeatInterval','match','body','send_reply','heartbeat\x20failed:\x20','/mcp','result','data:\x20','sdk-','send_message','message','alias','tools/call','text','19165TAbOWU','agent','ack_inbox','broadcast','sseAbort','reconnectDelay','get_all_status','new_task','244ZWUyeI','SSE\x20reconnecting\x20in\x20','38savXng','AbortError','SSE\x20error:\x20','status','toTimeString','Bearer\x20','read','text/event-stream','connectSSE','300PBUSRe','sleep','min','80381qpLuBM','s...','from_session','new_message','inbox\x20error:\x20','1773OkknaX','completed','registered','signal'];a0_0x10c1=function(){return _0x509aab;};return a0_0x10c1();}var $=T;export{$ as default,T as CommHub};
|