@sleep2agi/agent-network 2.3.0-preview.36 → 2.3.0-preview.37
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/README.md +35 -334
- 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/dist/src/opencode-agent-node-pair.d.ts +1 -1
- package/package.json +1 -1
package/dist/src/client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a0_0x6de1(_0x4e3e59,_0x1b9c4f){_0x4e3e59=_0x4e3e59-0xea;const _0x40fe82=a0_0x40fe();let _0x6de1e1=_0x40fe82[_0x4e3e59];return _0x6de1e1;}const a0_0x230d08=a0_0x6de1;function a0_0x40fe(){const _0x14968a=['url','slice','parse','new_task','sseAbort','text/event-stream','report_status','replace','emit','type','4091458iZWsQm','toTimeString','144765bkuQHm','/events/','catch','heartbeatInterval','getAllStatus','24726GPhIpb','token','connectSSE','520RwIKTP','running','10BPzsZx','signal','reconnectDelay','15568289UrBTPk','SSE\x20failed:\x20','new_message','disconnect','startsWith','text','5490CuQXkh','error','decode','Bearer\x20','get_inbox','s...','695eQhJwC','stringify','content','log','connected',']\x20[commhub:','now','task','sdk','normal','processInbox','sdk-','cwd','Authorization','min','agent','heartbeat\x20failed:\x20','message','get_all_status','status','pop','inbox\x20error:\x20','autoConnect','2.0','application/json,\x20text/event-stream','SSE\x20connected','connect','514lHxAnX','send_message','resumeId','call','disconnected','3430986Elwrzi','5313740UULazF','/mcp','send','getReader','reply','tools/call','alias','body','messages','ack_inbox','name','data:\x20','heartbeatTimer','read','broadcast','server','sleep','send_reply'];a0_0x40fe=function(){return _0x14968a;};return a0_0x40fe();}(function(_0x6bcbe2,_0x394dd0){const _0x28270e=a0_0x6de1,_0x11eb5c=_0x6bcbe2();while(!![]){try{const _0x3862fd=parseInt(_0x28270e(0x131))/0x1*(-parseInt(_0x28270e(0xfa))/0x2)+parseInt(_0x28270e(0xff))/0x3+-parseInt(_0x28270e(0x100))/0x4+parseInt(_0x28270e(0x137))/0x5*(-parseInt(_0x28270e(0x123))/0x6)+parseInt(_0x28270e(0x11c))/0x7+-parseInt(_0x28270e(0x126))/0x8*(-parseInt(_0x28270e(0x11e))/0x9)+parseInt(_0x28270e(0x128))/0xa*(parseInt(_0x28270e(0x12b))/0xb);if(_0x3862fd===_0x394dd0)break;else _0x11eb5c['push'](_0x11eb5c['shift']());}catch(_0x2fac3a){_0x11eb5c['push'](_0x11eb5c['shift']());}}}(a0_0x40fe,0xd60fc));import{EventEmitter as a0_0x5ce8b4}from'events';import{hostname as a0_0x37fdd8}from'os';class T extends a0_0x5ce8b4{[a0_0x230d08(0x112)];[a0_0x230d08(0x106)];[a0_0x230d08(0x124)];[a0_0x230d08(0xee)];['resumeId'];[a0_0x230d08(0x121)];[a0_0x230d08(0x12a)];[a0_0x230d08(0x10c)];['sseAbort'];[a0_0x230d08(0x127)]=!0x1;constructor(_0x5bc09d){const _0x5c0a7b=a0_0x230d08;super();if(this[_0x5c0a7b(0x112)]=_0x5bc09d[_0x5c0a7b(0x112)][_0x5c0a7b(0x119)](/\/$/,''),this[_0x5c0a7b(0x106)]=_0x5bc09d[_0x5c0a7b(0x106)],this[_0x5c0a7b(0x124)]=_0x5bc09d['token'],this[_0x5c0a7b(0xee)]=_0x5bc09d['agent']||_0x5c0a7b(0x13f),this[_0x5c0a7b(0xfc)]=_0x5c0a7b(0xea)+_0x5bc09d[_0x5c0a7b(0x106)]+'-'+Date[_0x5c0a7b(0x13d)]()['toString'](0x24),this[_0x5c0a7b(0x121)]=_0x5bc09d[_0x5c0a7b(0x121)]??0x2bf20,this[_0x5c0a7b(0x12a)]=_0x5bc09d[_0x5c0a7b(0x12a)]??0xbb8,_0x5bc09d[_0x5c0a7b(0xf5)]!==!0x1)this[_0x5c0a7b(0xf9)]();}[a0_0x230d08(0x13a)](_0x1f9b0e){const _0x275549=a0_0x230d08;console[_0x275549(0x13a)]('['+new Date()[_0x275549(0x11d)]()[_0x275549(0x113)](0x0,0x8)+_0x275549(0x13c)+this['alias']+']\x20'+_0x1f9b0e);}async['call'](_0x29f9c4,_0x201e70){const _0x411ac6=a0_0x230d08;let _0x220afa={'Content-Type':'application/json','Accept':_0x411ac6(0xf7)};if(this['token'])_0x220afa[_0x411ac6(0xec)]='Bearer\x20'+this['token'];let _0x4b27f6=await(await fetch(this[_0x411ac6(0x112)]+_0x411ac6(0x101),{'method':'POST','headers':_0x220afa,'body':JSON[_0x411ac6(0x138)]({'jsonrpc':_0x411ac6(0xf6),'id':Date[_0x411ac6(0x13d)](),'method':_0x411ac6(0x105),'params':{'name':_0x29f9c4,'arguments':_0x201e70}})}))[_0x411ac6(0x130)](),_0x5acd89=_0x4b27f6['match'](/data: (.+)/),_0x372246=_0x5acd89?JSON[_0x411ac6(0x114)](_0x5acd89[0x1]):JSON[_0x411ac6(0x114)](_0x4b27f6),_0x92053b=_0x372246?.['result']?.[_0x411ac6(0x139)]?.[0x0]?.['text'];return _0x92053b?JSON[_0x411ac6(0x114)](_0x92053b):_0x372246;}async[a0_0x230d08(0xf9)](){const _0x2ebdc6=a0_0x230d08;if(this[_0x2ebdc6(0x127)])return;this[_0x2ebdc6(0x127)]=!0x0,await this['status']('idle'),this[_0x2ebdc6(0x13a)]('registered'),this['heartbeatTimer']=setInterval(()=>{const _0x2f5259=_0x2ebdc6;this[_0x2f5259(0xf2)]('idle')[_0x2f5259(0x120)](_0x57cd61=>this[_0x2f5259(0x13a)](_0x2f5259(0xef)+_0x57cd61[_0x2f5259(0xf0)]));},this['heartbeatInterval']),this[_0x2ebdc6(0x125)]();}async[a0_0x230d08(0x12e)](){const _0x183f5f=a0_0x230d08;if(this[_0x183f5f(0x127)]=!0x1,this[_0x183f5f(0x116)]?.['abort'](),this[_0x183f5f(0x10c)])clearInterval(this['heartbeatTimer']);await this['status']('offline')[_0x183f5f(0x120)](()=>{}),this['log'](_0x183f5f(0xfe));}async[a0_0x230d08(0x102)](_0x3a7d95,_0x47a952,_0x36398e=a0_0x230d08(0x140)){const _0x2a160d=a0_0x230d08;return this[_0x2a160d(0xfd)]('send_task',{'alias':_0x3a7d95,'task':_0x47a952,'priority':_0x36398e,'from_session':this[_0x2a160d(0x106)]});}async[a0_0x230d08(0xf0)](_0x484042,_0xf535cf){const _0x24802d=a0_0x230d08;return this[_0x24802d(0xfd)](_0x24802d(0xfb),{'alias':_0x484042,'message':_0xf535cf,'from_session':this[_0x24802d(0x106)]});}async[a0_0x230d08(0x104)](_0x394ec4,_0x1abafa,_0x1408f2='completed'){const _0x144317=a0_0x230d08;return this[_0x144317(0xfd)](_0x144317(0x111),{'in_reply_to':_0x394ec4,'text':_0x1abafa,'status':_0x1408f2});}async[a0_0x230d08(0xf2)](_0x56e212,_0x2c4ef9){const _0x226ed9=a0_0x230d08;return this['call'](_0x226ed9(0x118),{'resume_id':this['resumeId'],'alias':this[_0x226ed9(0x106)],'status':_0x56e212,'server':a0_0x37fdd8(),'hostname':a0_0x37fdd8(),'agent':this[_0x226ed9(0xee)],'project_dir':process[_0x226ed9(0xeb)](),..._0x2c4ef9});}async[a0_0x230d08(0x122)](){const _0x4103bf=a0_0x230d08;return this[_0x4103bf(0xfd)](_0x4103bf(0xf1),{});}async[a0_0x230d08(0x10e)](_0x94aed9,_0x54955a){const _0x343276=a0_0x230d08;return this[_0x343276(0xfd)](_0x343276(0x10e),{'message':_0x94aed9,'filter_server':_0x54955a?.[_0x343276(0x10f)],'filter_status':_0x54955a?.['status']});}async[a0_0x230d08(0x125)](){const _0x3a741a=a0_0x230d08;let _0x38bfda=encodeURIComponent(this[_0x3a741a(0x106)]),_0x62700f=this[_0x3a741a(0x112)]+_0x3a741a(0x11f)+_0x38bfda,_0x18d07f=this[_0x3a741a(0x12a)];while(this[_0x3a741a(0x127)]){try{this['sseAbort']=new AbortController();let _0x386080={'Accept':_0x3a741a(0x117)};if(this['token'])_0x386080[_0x3a741a(0xec)]=_0x3a741a(0x134)+this['token'];let _0x25c195=await fetch(_0x62700f,{'headers':_0x386080,'signal':this[_0x3a741a(0x116)][_0x3a741a(0x129)]});if(!_0x25c195['ok']||!_0x25c195[_0x3a741a(0x107)]){this[_0x3a741a(0x13a)](_0x3a741a(0x12c)+_0x25c195[_0x3a741a(0xf2)]),await this['sleep'](_0x18d07f),_0x18d07f=Math[_0x3a741a(0xed)](_0x18d07f*1.5,0xea60);continue;}_0x18d07f=this['reconnectDelay'];let _0x223947=_0x25c195[_0x3a741a(0x107)][_0x3a741a(0x103)](),_0x47e6d3=new TextDecoder(),_0x291c17='';while(this[_0x3a741a(0x127)]){let {done:_0x7a321d,value:_0x5719eb}=await _0x223947[_0x3a741a(0x10d)]();if(_0x7a321d)break;_0x291c17+=_0x47e6d3[_0x3a741a(0x133)](_0x5719eb,{'stream':!0x0});let _0x544ff5=_0x291c17['split']('\x0a');_0x291c17=_0x544ff5[_0x3a741a(0xf3)]()||'';for(let _0xa90ef6 of _0x544ff5){if(!_0xa90ef6[_0x3a741a(0x12f)](_0x3a741a(0x10b)))continue;try{let _0x4003a3=JSON[_0x3a741a(0x114)](_0xa90ef6[_0x3a741a(0x113)](0x6));if(_0x4003a3[_0x3a741a(0x11b)]===_0x3a741a(0x13b)){this[_0x3a741a(0x13a)](_0x3a741a(0xf8)),this[_0x3a741a(0x11a)](_0x3a741a(0x13b));continue;}if(_0x4003a3['type']===_0x3a741a(0x115)||_0x4003a3['type']===_0x3a741a(0x12d)||_0x4003a3[_0x3a741a(0x11b)]===_0x3a741a(0x10e))await this[_0x3a741a(0x141)]();}catch{}}}}catch(_0x56ecd7){if(_0x56ecd7[_0x3a741a(0x10a)]==='AbortError')break;this[_0x3a741a(0x11a)](_0x3a741a(0x132),_0x56ecd7),this[_0x3a741a(0x13a)]('SSE\x20error:\x20'+_0x56ecd7['message']);}if(this[_0x3a741a(0x127)])this[_0x3a741a(0x11a)](_0x3a741a(0xfe)),this[_0x3a741a(0x13a)]('SSE\x20reconnecting\x20in\x20'+_0x18d07f/0x3e8+_0x3a741a(0x136)),await this['sleep'](_0x18d07f),_0x18d07f=Math[_0x3a741a(0xed)](_0x18d07f*1.5,0xea60);}}async[a0_0x230d08(0x141)](){const _0x549c3d=a0_0x230d08;try{let _0x4348a1=(await this[_0x549c3d(0xfd)](_0x549c3d(0x135),{'alias':this[_0x549c3d(0x106)],'limit':0xa}))?.[_0x549c3d(0x108)]||[];for(let _0x212c2b of _0x4348a1)await this[_0x549c3d(0xfd)](_0x549c3d(0x109),{'alias':this[_0x549c3d(0x106)],'message_id':_0x212c2b['id']}),this[_0x549c3d(0x13a)]('←\x20'+_0x212c2b['from_session']+':\x20'+_0x212c2b[_0x549c3d(0x139)][_0x549c3d(0x113)](0x0,0x3c)),this['emit'](_0x549c3d(0x13e),_0x212c2b),this[_0x549c3d(0x11a)](_0x549c3d(0xf0),_0x212c2b);}catch(_0x39cfba){this[_0x549c3d(0x13a)](_0x549c3d(0xf4)+_0x39cfba['message']);}}[a0_0x230d08(0x110)](_0x3aad9b){return new Promise(_0x44066d=>setTimeout(_0x44066d,_0x3aad9b));}}var $=T;export{$ as default,T as CommHub};
|