@sleep2agi/agent-network 2.3.0-preview.32 → 2.3.0-preview.34
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 +13 -3
- package/dist/bin/cli.d.ts +1 -1
- 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/normalize-runtime.d.ts +13 -1
- package/dist/src/opencode-agent-node-pair.d.ts +14 -0
- package/dist/src/opencode-auth-login.d.ts +43 -0
- package/dist/src/opencode-launch-env.d.ts +13 -0
- package/dist/src/opencode-owner-mode.d.ts +6 -0
- package/dist/src/opencode-package-binary.d.ts +21 -0
- package/dist/src/opencode-pin.d.ts +11 -8
- package/dist/src/opencode-preset.d.ts +38 -8
- package/dist/src/opencode-runtime-binding.d.ts +30 -0
- package/dist/src/opencode-safe-root.d.ts +27 -0
- package/dist/src/opencode-smoke-env.d.ts +1 -0
- package/package.json +4 -3
package/dist/src/client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a0_0x9418(){const _0x454798=['sdk-','completed','ack_inbox','processInbox','connect','heartbeatInterval','reconnectDelay','split','token','1102851pkALrK','/mcp','log','send_task','offline','agent','startsWith','call','Bearer\x20','sleep','heartbeat\x20failed:\x20','18GUttkd','POST','send_reply','sseAbort','parse','catch','send','messages','reply','url','tools/call','application/json,\x20text/event-stream','abort','slice','type','task','connected','error','read','getReader','Authorization','resumeId','SSE\x20connected','disconnected','809568YMGlFg','send_message','disconnect','1366000cyTevn','status','emit','2.0',']\x20[commhub:','getAllStatus','content','message','connectSSE','heartbeatTimer','now','5KuWHWF','184404Gpvqqb','body','5157060mOPyCN','application/json','/events/','inbox\x20error:\x20','849175IXKUxY','get_all_status','server','5056992FStvGn','broadcast','running','s...','SSE\x20failed:\x20','text/event-stream','name','SSE\x20error:\x20','alias','idle','35fvCLtW'];a0_0x9418=function(){return _0x454798;};return a0_0x9418();}const a0_0x5a1909=a0_0x4e34;(function(_0x2865f9,_0x3761fc){const _0x5ebf3d=a0_0x4e34,_0x15d8d9=_0x2865f9();while(!![]){try{const _0x3d8dfe=parseInt(_0x5ebf3d(0x106))/0x1*(-parseInt(_0x5ebf3d(0x107))/0x2)+parseInt(_0x5ebf3d(0xd5))/0x3+parseInt(_0x5ebf3d(0xfb))/0x4+-parseInt(_0x5ebf3d(0xbe))/0x5*(parseInt(_0x5ebf3d(0xe0))/0x6)+-parseInt(_0x5ebf3d(0xcb))/0x7*(-parseInt(_0x5ebf3d(0xf8))/0x8)+parseInt(_0x5ebf3d(0xc1))/0x9+-parseInt(_0x5ebf3d(0x109))/0xa;if(_0x3d8dfe===_0x3761fc)break;else _0x15d8d9['push'](_0x15d8d9['shift']());}catch(_0x3b4465){_0x15d8d9['push'](_0x15d8d9['shift']());}}}(a0_0x9418,0x46fcc));function a0_0x4e34(_0x3b0a03,_0x34118d){_0x3b0a03=_0x3b0a03-0xbb;const _0x94180e=a0_0x9418();let _0x4e3437=_0x94180e[_0x3b0a03];return _0x4e3437;}import{EventEmitter as a0_0x536da2}from'events';import{hostname as a0_0x1ffcb0}from'os';class T extends a0_0x536da2{['url'];[a0_0x5a1909(0xc9)];[a0_0x5a1909(0xd4)];[a0_0x5a1909(0xda)];[a0_0x5a1909(0xf5)];[a0_0x5a1909(0xd1)];[a0_0x5a1909(0xd2)];['heartbeatTimer'];[a0_0x5a1909(0xe3)];[a0_0x5a1909(0xc3)]=!0x1;constructor(_0x36c4fe){const _0x1bfaff=a0_0x5a1909;super();if(this['url']=_0x36c4fe[_0x1bfaff(0xe9)]['replace'](/\/$/,''),this[_0x1bfaff(0xc9)]=_0x36c4fe[_0x1bfaff(0xc9)],this[_0x1bfaff(0xd4)]=_0x36c4fe['token'],this[_0x1bfaff(0xda)]=_0x36c4fe[_0x1bfaff(0xda)]||'sdk',this[_0x1bfaff(0xf5)]=_0x1bfaff(0xcc)+_0x36c4fe[_0x1bfaff(0xc9)]+'-'+Date[_0x1bfaff(0x105)]()['toString'](0x24),this[_0x1bfaff(0xd1)]=_0x36c4fe['heartbeatInterval']??0x2bf20,this[_0x1bfaff(0xd2)]=_0x36c4fe[_0x1bfaff(0xd2)]??0xbb8,_0x36c4fe['autoConnect']!==!0x1)this[_0x1bfaff(0xd0)]();}[a0_0x5a1909(0xd7)](_0xac0e7e){const _0x1e7171=a0_0x5a1909;console['log']('['+new Date()['toTimeString']()[_0x1e7171(0xed)](0x0,0x8)+_0x1e7171(0xff)+this[_0x1e7171(0xc9)]+']\x20'+_0xac0e7e);}async[a0_0x5a1909(0xdc)](_0x94ed95,_0x215f21){const _0x5dfb3f=a0_0x5a1909;let _0x3d96f9={'Content-Type':_0x5dfb3f(0xbb),'Accept':_0x5dfb3f(0xeb)};if(this[_0x5dfb3f(0xd4)])_0x3d96f9[_0x5dfb3f(0xf4)]=_0x5dfb3f(0xdd)+this[_0x5dfb3f(0xd4)];let _0x4f4ade=await(await fetch(this[_0x5dfb3f(0xe9)]+_0x5dfb3f(0xd6),{'method':_0x5dfb3f(0xe1),'headers':_0x3d96f9,'body':JSON['stringify']({'jsonrpc':_0x5dfb3f(0xfe),'id':Date['now'](),'method':_0x5dfb3f(0xea),'params':{'name':_0x94ed95,'arguments':_0x215f21}})}))['text'](),_0x57a7a1=_0x4f4ade['match'](/data: (.+)/),_0x284fcf=_0x57a7a1?JSON[_0x5dfb3f(0xe4)](_0x57a7a1[0x1]):JSON[_0x5dfb3f(0xe4)](_0x4f4ade),_0x5b6cc3=_0x284fcf?.['result']?.[_0x5dfb3f(0x101)]?.[0x0]?.['text'];return _0x5b6cc3?JSON[_0x5dfb3f(0xe4)](_0x5b6cc3):_0x284fcf;}async[a0_0x5a1909(0xd0)](){const _0x5d92e4=a0_0x5a1909;if(this['running'])return;this['running']=!0x0,await this[_0x5d92e4(0xfc)](_0x5d92e4(0xca)),this['log']('registered'),this[_0x5d92e4(0x104)]=setInterval(()=>{const _0x13bb35=_0x5d92e4;this[_0x13bb35(0xfc)]('idle')['catch'](_0x43940e=>this[_0x13bb35(0xd7)](_0x13bb35(0xdf)+_0x43940e[_0x13bb35(0x102)]));},this[_0x5d92e4(0xd1)]),this['connectSSE']();}async[a0_0x5a1909(0xfa)](){const _0x5e789a=a0_0x5a1909;if(this[_0x5e789a(0xc3)]=!0x1,this[_0x5e789a(0xe3)]?.[_0x5e789a(0xec)](),this['heartbeatTimer'])clearInterval(this[_0x5e789a(0x104)]);await this[_0x5e789a(0xfc)](_0x5e789a(0xd9))[_0x5e789a(0xe5)](()=>{}),this[_0x5e789a(0xd7)](_0x5e789a(0xf7));}async[a0_0x5a1909(0xe6)](_0x11c606,_0x2ba2d3,_0x2b6299='normal'){const _0x573381=a0_0x5a1909;return this[_0x573381(0xdc)](_0x573381(0xd8),{'alias':_0x11c606,'task':_0x2ba2d3,'priority':_0x2b6299,'from_session':this[_0x573381(0xc9)]});}async['message'](_0x4d2249,_0x5c2fc4){const _0xfaf92f=a0_0x5a1909;return this[_0xfaf92f(0xdc)](_0xfaf92f(0xf9),{'alias':_0x4d2249,'message':_0x5c2fc4,'from_session':this[_0xfaf92f(0xc9)]});}async[a0_0x5a1909(0xe8)](_0x1e4478,_0x3c89bf,_0x403566=a0_0x5a1909(0xcd)){const _0x361e4f=a0_0x5a1909;return this[_0x361e4f(0xdc)](_0x361e4f(0xe2),{'in_reply_to':_0x1e4478,'text':_0x3c89bf,'status':_0x403566});}async[a0_0x5a1909(0xfc)](_0x3bcca2,_0xd343fa){const _0x59c013=a0_0x5a1909;return this[_0x59c013(0xdc)]('report_status',{'resume_id':this[_0x59c013(0xf5)],'alias':this[_0x59c013(0xc9)],'status':_0x3bcca2,'server':a0_0x1ffcb0(),'hostname':a0_0x1ffcb0(),'agent':this[_0x59c013(0xda)],'project_dir':process['cwd'](),..._0xd343fa});}async[a0_0x5a1909(0x100)](){const _0x1ea804=a0_0x5a1909;return this[_0x1ea804(0xdc)](_0x1ea804(0xbf),{});}async['broadcast'](_0x1b15e3,_0x13f9e1){const _0x376bad=a0_0x5a1909;return this[_0x376bad(0xdc)](_0x376bad(0xc2),{'message':_0x1b15e3,'filter_server':_0x13f9e1?.[_0x376bad(0xc0)],'filter_status':_0x13f9e1?.[_0x376bad(0xfc)]});}async[a0_0x5a1909(0x103)](){const _0x30be42=a0_0x5a1909;let _0xd3dc6d=encodeURIComponent(this['alias']),_0x1634ca=this[_0x30be42(0xe9)]+_0x30be42(0xbc)+_0xd3dc6d,_0x10ce93=this['reconnectDelay'];while(this[_0x30be42(0xc3)]){try{this[_0x30be42(0xe3)]=new AbortController();let _0x27184b={'Accept':_0x30be42(0xc6)};if(this[_0x30be42(0xd4)])_0x27184b[_0x30be42(0xf4)]='Bearer\x20'+this[_0x30be42(0xd4)];let _0x66c85b=await fetch(_0x1634ca,{'headers':_0x27184b,'signal':this[_0x30be42(0xe3)]['signal']});if(!_0x66c85b['ok']||!_0x66c85b[_0x30be42(0x108)]){this[_0x30be42(0xd7)](_0x30be42(0xc5)+_0x66c85b[_0x30be42(0xfc)]),await this[_0x30be42(0xde)](_0x10ce93),_0x10ce93=Math['min'](_0x10ce93*1.5,0xea60);continue;}_0x10ce93=this['reconnectDelay'];let _0x2a9a54=_0x66c85b['body'][_0x30be42(0xf3)](),_0x362655=new TextDecoder(),_0xb7259e='';while(this['running']){let {done:_0x589725,value:_0x4dc8ba}=await _0x2a9a54[_0x30be42(0xf2)]();if(_0x589725)break;_0xb7259e+=_0x362655['decode'](_0x4dc8ba,{'stream':!0x0});let _0x2105a0=_0xb7259e[_0x30be42(0xd3)]('\x0a');_0xb7259e=_0x2105a0['pop']()||'';for(let _0x30924a of _0x2105a0){if(!_0x30924a[_0x30be42(0xdb)]('data:\x20'))continue;try{let _0x5ef844=JSON[_0x30be42(0xe4)](_0x30924a[_0x30be42(0xed)](0x6));if(_0x5ef844[_0x30be42(0xee)]===_0x30be42(0xf0)){this['log'](_0x30be42(0xf6)),this['emit'](_0x30be42(0xf0));continue;}if(_0x5ef844['type']==='new_task'||_0x5ef844[_0x30be42(0xee)]==='new_message'||_0x5ef844[_0x30be42(0xee)]===_0x30be42(0xc2))await this[_0x30be42(0xcf)]();}catch{}}}}catch(_0x574727){if(_0x574727[_0x30be42(0xc7)]==='AbortError')break;this[_0x30be42(0xfd)](_0x30be42(0xf1),_0x574727),this['log'](_0x30be42(0xc8)+_0x574727[_0x30be42(0x102)]);}if(this['running'])this[_0x30be42(0xfd)]('disconnected'),this[_0x30be42(0xd7)]('SSE\x20reconnecting\x20in\x20'+_0x10ce93/0x3e8+_0x30be42(0xc4)),await this['sleep'](_0x10ce93),_0x10ce93=Math['min'](_0x10ce93*1.5,0xea60);}}async[a0_0x5a1909(0xcf)](){const _0x8c91ed=a0_0x5a1909;try{let _0x46203c=(await this['call']('get_inbox',{'alias':this[_0x8c91ed(0xc9)],'limit':0xa}))?.[_0x8c91ed(0xe7)]||[];for(let _0x3c15ce of _0x46203c)await this[_0x8c91ed(0xdc)](_0x8c91ed(0xce),{'alias':this['alias'],'message_id':_0x3c15ce['id']}),this[_0x8c91ed(0xd7)]('←\x20'+_0x3c15ce['from_session']+':\x20'+_0x3c15ce[_0x8c91ed(0x101)]['slice'](0x0,0x3c)),this[_0x8c91ed(0xfd)](_0x8c91ed(0xef),_0x3c15ce),this[_0x8c91ed(0xfd)](_0x8c91ed(0x102),_0x3c15ce);}catch(_0x167d4f){this[_0x8c91ed(0xd7)](_0x8c91ed(0xbd)+_0x167d4f[_0x8c91ed(0x102)]);}}[a0_0x5a1909(0xde)](_0x28f9a4){return new Promise(_0x1df5c7=>setTimeout(_0x1df5c7,_0x28f9a4));}}var $=T;export{$ as default,T as CommHub};
|