@sleep2agi/agent-network 2.3.0-preview.31 → 2.3.0-preview.33
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_0xabe5fa=a0_0x488d;(function(_0x31e846,_0x222515){const _0x175214=a0_0x488d,_0x1967a4=_0x31e846();while(!![]){try{const _0x98b6e7=-parseInt(_0x175214(0xa6))/0x1*(-parseInt(_0x175214(0xa2))/0x2)+-parseInt(_0x175214(0x8d))/0x3*(-parseInt(_0x175214(0x7d))/0x4)+-parseInt(_0x175214(0xa9))/0x5+parseInt(_0x175214(0xb6))/0x6+parseInt(_0x175214(0xcf))/0x7*(-parseInt(_0x175214(0xb7))/0x8)+-parseInt(_0x175214(0xce))/0x9*(-parseInt(_0x175214(0x78))/0xa)+parseInt(_0x175214(0x88))/0xb*(-parseInt(_0x175214(0x7b))/0xc);if(_0x98b6e7===_0x222515)break;else _0x1967a4['push'](_0x1967a4['shift']());}catch(_0x1caa2e){_0x1967a4['push'](_0x1967a4['shift']());}}}(a0_0x1290,0x59f6d));import{EventEmitter as a0_0x539576}from'events';function a0_0x488d(_0x4a470f,_0x4a68b2){_0x4a470f=_0x4a470f-0x78;const _0x1290f6=a0_0x1290();let _0x488d8=_0x1290f6[_0x4a470f];return _0x488d8;}import{hostname as a0_0x394ad7}from'os';class T extends a0_0x539576{['url'];[a0_0xabe5fa(0xb2)];[a0_0xabe5fa(0xbf)];[a0_0xabe5fa(0x9f)];['resumeId'];[a0_0xabe5fa(0x8b)];[a0_0xabe5fa(0x9b)];['heartbeatTimer'];[a0_0xabe5fa(0xb5)];['running']=!0x1;constructor(_0x4d5613){const _0x577477=a0_0xabe5fa;super();if(this[_0x577477(0x8e)]=_0x4d5613[_0x577477(0x8e)][_0x577477(0x9a)](/\/$/,''),this['alias']=_0x4d5613[_0x577477(0xb2)],this[_0x577477(0xbf)]=_0x4d5613[_0x577477(0xbf)],this[_0x577477(0x9f)]=_0x4d5613['agent']||'sdk',this[_0x577477(0xae)]=_0x577477(0xc2)+_0x4d5613[_0x577477(0xb2)]+'-'+Date[_0x577477(0xbb)]()[_0x577477(0xa0)](0x24),this[_0x577477(0x8b)]=_0x4d5613[_0x577477(0x8b)]??0x2bf20,this[_0x577477(0x9b)]=_0x4d5613[_0x577477(0x9b)]??0xbb8,_0x4d5613['autoConnect']!==!0x1)this['connect']();}[a0_0xabe5fa(0x99)](_0x23c816){const _0xb18d1e=a0_0xabe5fa;console['log']('['+new Date()[_0xb18d1e(0xa5)]()[_0xb18d1e(0xc9)](0x0,0x8)+_0xb18d1e(0x7a)+this['alias']+']\x20'+_0x23c816);}async['call'](_0x4f4d7b,_0x182fa3){const _0x282218=a0_0xabe5fa;let _0x2de449={'Content-Type':_0x282218(0x97),'Accept':_0x282218(0xa1)};if(this[_0x282218(0xbf)])_0x2de449[_0x282218(0x8f)]='Bearer\x20'+this['token'];let _0x30087f=await(await fetch(this[_0x282218(0x8e)]+_0x282218(0x86),{'method':_0x282218(0xa3),'headers':_0x2de449,'body':JSON[_0x282218(0xc0)]({'jsonrpc':_0x282218(0xc1),'id':Date[_0x282218(0xbb)](),'method':_0x282218(0xb9),'params':{'name':_0x4f4d7b,'arguments':_0x182fa3}})}))[_0x282218(0xad)](),_0x26ce7c=_0x30087f['match'](/data: (.+)/),_0xd1ef47=_0x26ce7c?JSON[_0x282218(0xcd)](_0x26ce7c[0x1]):JSON[_0x282218(0xcd)](_0x30087f),_0x11f951=_0xd1ef47?.[_0x282218(0xab)]?.[_0x282218(0xbd)]?.[0x0]?.['text'];return _0x11f951?JSON[_0x282218(0xcd)](_0x11f951):_0xd1ef47;}async[a0_0xabe5fa(0xb3)](){const _0x31d312=a0_0xabe5fa;if(this[_0x31d312(0x91)])return;this['running']=!0x0,await this[_0x31d312(0xc8)](_0x31d312(0x79)),this[_0x31d312(0x99)](_0x31d312(0xb8)),this['heartbeatTimer']=setInterval(()=>{const _0x331cdb=_0x31d312;this[_0x331cdb(0xc8)](_0x331cdb(0x79))[_0x331cdb(0xc4)](_0x2b2f1b=>this[_0x331cdb(0x99)]('heartbeat\x20failed:\x20'+_0x2b2f1b[_0x331cdb(0xa7)]));},this['heartbeatInterval']),this[_0x31d312(0x90)]();}async[a0_0xabe5fa(0x94)](){const _0x23d47b=a0_0xabe5fa;if(this['running']=!0x1,this[_0x23d47b(0xb5)]?.[_0x23d47b(0xa4)](),this[_0x23d47b(0x84)])clearInterval(this[_0x23d47b(0x84)]);await this[_0x23d47b(0xc8)](_0x23d47b(0xac))[_0x23d47b(0xc4)](()=>{}),this[_0x23d47b(0x99)]('disconnected');}async['send'](_0xcbbf04,_0x32ea89,_0x371feb=a0_0xabe5fa(0xc7)){const _0x6b0db1=a0_0xabe5fa;return this[_0x6b0db1(0xb0)](_0x6b0db1(0x96),{'alias':_0xcbbf04,'task':_0x32ea89,'priority':_0x371feb,'from_session':this[_0x6b0db1(0xb2)]});}async[a0_0xabe5fa(0xa7)](_0x1beb3c,_0x29110d){const _0x505808=a0_0xabe5fa;return this['call']('send_message',{'alias':_0x1beb3c,'message':_0x29110d,'from_session':this[_0x505808(0xb2)]});}async[a0_0xabe5fa(0x89)](_0x243768,_0x5cedb4,_0x24e5da='completed'){const _0x4011b9=a0_0xabe5fa;return this[_0x4011b9(0xb0)](_0x4011b9(0xb4),{'in_reply_to':_0x243768,'text':_0x5cedb4,'status':_0x24e5da});}async[a0_0xabe5fa(0xc8)](_0xc4483a,_0x126e7e){const _0x74046f=a0_0xabe5fa;return this['call']('report_status',{'resume_id':this[_0x74046f(0xae)],'alias':this[_0x74046f(0xb2)],'status':_0xc4483a,'server':a0_0x394ad7(),'hostname':a0_0x394ad7(),'agent':this[_0x74046f(0x9f)],'project_dir':process[_0x74046f(0x8c)](),..._0x126e7e});}async[a0_0xabe5fa(0x81)](){const _0x3b48c3=a0_0xabe5fa;return this[_0x3b48c3(0xb0)]('get_all_status',{});}async[a0_0xabe5fa(0xa8)](_0x2ed927,_0x1e4d53){const _0x226893=a0_0xabe5fa;return this[_0x226893(0xb0)](_0x226893(0xa8),{'message':_0x2ed927,'filter_server':_0x1e4d53?.[_0x226893(0xaf)],'filter_status':_0x1e4d53?.[_0x226893(0xc8)]});}async['connectSSE'](){const _0x5cea1f=a0_0xabe5fa;let _0xd04e5=encodeURIComponent(this[_0x5cea1f(0xb2)]),_0x2ffd1c=this['url']+_0x5cea1f(0xcb)+_0xd04e5,_0x164717=this[_0x5cea1f(0x9b)];while(this[_0x5cea1f(0x91)]){try{this[_0x5cea1f(0xb5)]=new AbortController();let _0x399b0b={'Accept':'text/event-stream'};if(this[_0x5cea1f(0xbf)])_0x399b0b[_0x5cea1f(0x8f)]=_0x5cea1f(0xbc)+this['token'];let _0x5d1e9f=await fetch(_0x2ffd1c,{'headers':_0x399b0b,'signal':this[_0x5cea1f(0xb5)][_0x5cea1f(0x7e)]});if(!_0x5d1e9f['ok']||!_0x5d1e9f[_0x5cea1f(0x82)]){this[_0x5cea1f(0x99)](_0x5cea1f(0x83)+_0x5d1e9f[_0x5cea1f(0xc8)]),await this['sleep'](_0x164717),_0x164717=Math[_0x5cea1f(0x80)](_0x164717*1.5,0xea60);continue;}_0x164717=this[_0x5cea1f(0x9b)];let _0x39ba1a=_0x5d1e9f[_0x5cea1f(0x82)][_0x5cea1f(0x98)](),_0x10655b=new TextDecoder(),_0x104c45='';while(this[_0x5cea1f(0x91)]){let {done:_0x102c94,value:_0x34d5f4}=await _0x39ba1a[_0x5cea1f(0xcc)]();if(_0x102c94)break;_0x104c45+=_0x10655b[_0x5cea1f(0x92)](_0x34d5f4,{'stream':!0x0});let _0x32474c=_0x104c45[_0x5cea1f(0x7f)]('\x0a');_0x104c45=_0x32474c[_0x5cea1f(0x9e)]()||'';for(let _0x3152ad of _0x32474c){if(!_0x3152ad[_0x5cea1f(0xba)]('data:\x20'))continue;try{let _0x4815a2=JSON[_0x5cea1f(0xcd)](_0x3152ad[_0x5cea1f(0xc9)](0x6));if(_0x4815a2[_0x5cea1f(0x95)]===_0x5cea1f(0x87)){this[_0x5cea1f(0x99)](_0x5cea1f(0x93)),this[_0x5cea1f(0x9c)](_0x5cea1f(0x87));continue;}if(_0x4815a2[_0x5cea1f(0x95)]==='new_task'||_0x4815a2[_0x5cea1f(0x95)]===_0x5cea1f(0xca)||_0x4815a2['type']===_0x5cea1f(0xa8))await this[_0x5cea1f(0x7c)]();}catch{}}}}catch(_0xeda958){if(_0xeda958['name']==='AbortError')break;this[_0x5cea1f(0x9c)](_0x5cea1f(0x85),_0xeda958),this[_0x5cea1f(0x99)](_0x5cea1f(0x8a)+_0xeda958[_0x5cea1f(0xa7)]);}if(this[_0x5cea1f(0x91)])this[_0x5cea1f(0x9c)]('disconnected'),this[_0x5cea1f(0x99)]('SSE\x20reconnecting\x20in\x20'+_0x164717/0x3e8+_0x5cea1f(0xb1)),await this[_0x5cea1f(0xc6)](_0x164717),_0x164717=Math[_0x5cea1f(0x80)](_0x164717*1.5,0xea60);}}async[a0_0xabe5fa(0x7c)](){const _0x2cf4ba=a0_0xabe5fa;try{let _0x1fdf6a=(await this['call'](_0x2cf4ba(0x9d),{'alias':this[_0x2cf4ba(0xb2)],'limit':0xa}))?.[_0x2cf4ba(0xaa)]||[];for(let _0x171ffe of _0x1fdf6a)await this['call'](_0x2cf4ba(0xc5),{'alias':this[_0x2cf4ba(0xb2)],'message_id':_0x171ffe['id']}),this[_0x2cf4ba(0x99)]('←\x20'+_0x171ffe[_0x2cf4ba(0xc3)]+':\x20'+_0x171ffe[_0x2cf4ba(0xbd)]['slice'](0x0,0x3c)),this[_0x2cf4ba(0x9c)](_0x2cf4ba(0xbe),_0x171ffe),this['emit'](_0x2cf4ba(0xa7),_0x171ffe);}catch(_0x119411){this['log']('inbox\x20error:\x20'+_0x119411[_0x2cf4ba(0xa7)]);}}[a0_0xabe5fa(0xc6)](_0x49f5f4){return new Promise(_0x280c68=>setTimeout(_0x280c68,_0x49f5f4));}}var $=T;function a0_0x1290(){const _0x5b48b2=['running','decode','SSE\x20connected','disconnect','type','send_task','application/json','getReader','log','replace','reconnectDelay','emit','get_inbox','pop','agent','toString','application/json,\x20text/event-stream','1846eddNFT','POST','abort','toTimeString','362SCwjuB','message','broadcast','1330825Xsjlgl','messages','result','offline','text','resumeId','server','call','s...','alias','connect','send_reply','sseAbort','3498084KcTNcN','2682128NKgdIG','registered','tools/call','startsWith','now','Bearer\x20','content','task','token','stringify','2.0','sdk-','from_session','catch','ack_inbox','sleep','normal','status','slice','new_message','/events/','read','parse','10503JbvgtN','7MHDLBE','30CbvovA','idle',']\x20[commhub:','137532PzBAaT','processInbox','452qPXuVf','signal','split','min','getAllStatus','body','SSE\x20failed:\x20','heartbeatTimer','error','/mcp','connected','385BBuGDz','reply','SSE\x20error:\x20','heartbeatInterval','cwd','11958uoMnzl','url','Authorization','connectSSE'];a0_0x1290=function(){return _0x5b48b2;};return a0_0x1290();}export{$ as default,T as CommHub};
|