@sleep2agi/agent-network 2.3.0-preview.164 → 2.3.0-preview.166
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 +2 -2
- package/dist/src/client.js +1 -1
- package/dist/src/codex-external-appserver.d.ts +3 -1
- package/dist/src/daemon-codex-inventory.d.ts +32 -2
- package/dist/src/daemon-provider-application.d.ts +2 -0
- package/dist/src/daemon-provider-collect.d.ts +29 -0
- package/dist/src/daemon-provider-command.d.ts +1 -1
- package/dist/src/daemon-provider-initialize.d.ts +27 -0
- package/dist/src/node-server.js +8 -8
- package/dist/src/opencode-agent-node-pair.d.ts +6 -6
- package/dist/src/shared/provider-collection.d.ts +9 -0
- package/dist/src/shared/provider-initialization.d.ts +7 -0
- package/dist/src/standalone-bin.d.ts +101 -0
- package/dist/src/standalone-build-stamp.d.ts +33 -0
- package/package.json +1 -1
package/dist/src/client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a0_0x6aaf68=a0_0x1bd3;(function(_0x2a7878,_0xd6883c){const _0x3d0bb4=a0_0x1bd3,_0x5f550b=_0x2a7878();while(!![]){try{const _0x48a204=-parseInt(_0x3d0bb4(0x175))/0x1*(parseInt(_0x3d0bb4(0x138))/0x2)+parseInt(_0x3d0bb4(0x14d))/0x3+-parseInt(_0x3d0bb4(0x161))/0x4+-parseInt(_0x3d0bb4(0x10c))/0x5+-parseInt(_0x3d0bb4(0x143))/0x6+-parseInt(_0x3d0bb4(0x169))/0x7*(-parseInt(_0x3d0bb4(0x185))/0x8)+-parseInt(_0x3d0bb4(0x13b))/0x9*(-parseInt(_0x3d0bb4(0x155))/0xa);if(_0x48a204===_0xd6883c)break;else _0x5f550b['push'](_0x5f550b['shift']());}catch(_0x319fab){_0x5f550b['push'](_0x5f550b['shift']());}}}(a0_0x44a7,0x76af7));function a0_0x1bd3(_0x4ee2bf,_0x5511bc){_0x4ee2bf=_0x4ee2bf-0x103;const _0x44a7ff=a0_0x44a7();let _0x1bd37c=_0x44a7ff[_0x4ee2bf];return _0x1bd37c;}import{EventEmitter as a0_0x6a1d46}from'events';import{hostname as a0_0x42f55e}from'os';var K=/(?:atok|ntok|utok|ghp|github_pat)_[A-Za-z0-9_-]+|Bearer\s+\S+/gi,L=(_0x21797b,_0x4bb4bd)=>(_0x21797b??_0x4bb4bd)['replace'](/[\r\n\x00-\x1f\x7f]/g,'\x20')['slice'](0x0,0xf0);function a0_0x44a7(){const _0x21db26=['sending','delivered','88144wknKmU','missing_task_id','agent','7520427azPWWN','SSE\x20failed:\x20','2.0','task_id','ack_inbox','task','call','reply','5823180qGQAmK','application/json','offline','catch','send_rejected','inbox\x20error:\x20','\x20to=','<missing>','now','\x20from=','140778vbOwtZ','s...','alias','SSE\x20reconnecting\x20in\x20','to_alias','connect','reconnectDelay','new_task','20wvlxVM','running','parentTaskId',']\x20[commhub:','messages','error_code','SSE\x20error:\x20','text','networkId','error','/mcp','processInbox','592116vUfOkf','normal','heartbeatInterval','\x20error=','CommHub\x20response\x20omitted\x20task_id','text/event-stream','task.replied','split','357ZRJeCv','disconnected','getReader','connectSSE','string','name','[REDACTED]','send_reply','task.send.failed','\x20task_id=','json','task.ack','3xPmEXN','network_id','registered','duration_ms','message_id','stringify','replace','parent_task_id','failed','broadcast','lifecycle_tracking','get_all_status','[commhub:task]\x20','\x20transport=','body','/events/','75224uFOHqg','pop','heartbeatTimer','lifecycleTracking','signal','send','status','message','cwd','send_message','2303875jOIktg','task.expired','toAlias','send_task','token','from_alias','slice','application/json,\x20text/event-stream','resumeId','task.send.delivered','server','content','result','fromAlias','emit','<unknown>','getAllStatus','send_failed','sleep','completed','toTimeString','sseAbort','transport','task.send.start','parse','log','mcp_http','url','sdk','idle','Authorization','decode','connected','type','min','abort','data:\x20','\x20duration_ms=','task.started','Bearer\x20','new_message','\x20lifecycle='];a0_0x44a7=function(){return _0x21db26;};return a0_0x44a7();}function N(_0x55776b){const _0x25a538=a0_0x1bd3;return(_0x55776b instanceof Error?_0x55776b[_0x25a538(0x109)]:String(_0x55776b??'unknown\x20error'))[_0x25a538(0x17b)](K,_0x25a538(0x16f))[_0x25a538(0x17b)](/[\r\n\x00-\x1f\x7f]/g,'\x20')[_0x25a538(0x112)](0x0,0xf0);}function O(_0x30c9a6,_0x224bcc=process.env.ANET_TASK_TRACE_FORMAT===a0_0x6aaf68(0x173)){const _0x24a34f=a0_0x6aaf68;if(_0x224bcc)return JSON[_0x24a34f(0x17a)](_0x30c9a6);let _0x421439=L(_0x30c9a6[_0x24a34f(0x17c)],_0x24a34f(0x14a)),_0x407db8=L(_0x30c9a6[_0x24a34f(0x13e)],'<pending>'),_0xba3503=_0x30c9a6[_0x24a34f(0x15a)]?_0x24a34f(0x164)+_0x30c9a6['error_code']+':'+(_0x30c9a6['error_message']??''):'';return _0x24a34f(0x181)+_0x30c9a6[_0x24a34f(0x108)]+_0x24a34f(0x14c)+L(_0x30c9a6[_0x24a34f(0x111)],_0x24a34f(0x11b))+_0x24a34f(0x149)+L(_0x30c9a6[_0x24a34f(0x151)],_0x24a34f(0x11b))+_0x24a34f(0x172)+_0x407db8+'\x20parent_task_id='+_0x421439+'\x20network_id='+L(_0x30c9a6[_0x24a34f(0x176)],'<unknown>')+_0x24a34f(0x182)+_0x30c9a6[_0x24a34f(0x122)]+_0x24a34f(0x131)+_0x30c9a6[_0x24a34f(0x178)]+_0x24a34f(0x135)+_0x30c9a6[_0x24a34f(0x17f)]+_0xba3503;}function U(_0x335cc3){const _0x2da320=a0_0x6aaf68;return{'event':{'sending':_0x2da320(0x123),'delivered':_0x2da320(0x115),'failed':_0x2da320(0x171),'acked':_0x2da320(0x174),'started':_0x2da320(0x132),'replied':_0x2da320(0x167),'expired':_0x2da320(0x10d)}[_0x335cc3[_0x2da320(0x108)]],..._0x335cc3};}function j(_0x5b10a1){const _0x478729=a0_0x6aaf68;let _0x33760e=_0x5b10a1?.[_0x478729(0x13e)]||_0x5b10a1?.[_0x478729(0x179)]||_0x5b10a1?.['id'];if(_0x33760e)return String(_0x33760e);let _0x2cb5eb=_0x5b10a1?.['content']?.[0x0]?.[_0x478729(0x15c)];if(typeof _0x2cb5eb!==_0x478729(0x16d))return null;try{let _0x420b6e=JSON[_0x478729(0x124)](_0x2cb5eb);return _0x420b6e?.[_0x478729(0x13e)]||_0x420b6e?.[_0x478729(0x179)]||_0x420b6e?.['id']||null;}catch{return null;}}async function X(_0x225cc3,_0xf982f3){const _0x5bf3c5=a0_0x6aaf68;let _0x230771=_0xf982f3[_0x5bf3c5(0x14b)]??Date[_0x5bf3c5(0x14b)],_0x3bf6a7=_0x230771(),_0x3898ce=(_0x117969,_0x418d39,_0x5d0ee4,_0x5910a4)=>{const _0x12afed=_0x5bf3c5;_0xf982f3[_0x12afed(0x125)](O(U({'from_alias':_0x225cc3[_0x12afed(0x119)],'to_alias':_0x225cc3[_0x12afed(0x10e)],'task_id':_0x418d39,'parent_task_id':_0x225cc3[_0x12afed(0x157)],'network_id':_0x225cc3[_0x12afed(0x15d)],'transport':_0x225cc3['transport'],'status':_0x117969,'duration_ms':_0x230771()-_0x3bf6a7,'lifecycle_tracking':_0x225cc3[_0x12afed(0x105)],..._0x5d0ee4!==void 0x0?{'error_code':_0x5910a4||_0x12afed(0x11d),'error_message':N(_0x5d0ee4)}:{}})));};_0x3898ce(_0x5bf3c5(0x136),null);try{let _0x11ff63=await _0xf982f3[_0x5bf3c5(0x107)](),_0x5eef82=j(_0x11ff63);if(_0x5eef82)_0x3898ce(_0x5bf3c5(0x137),_0x5eef82);else{if(_0x11ff63?.['ok']===!0x1||_0x11ff63?.['error'])_0x3898ce(_0x5bf3c5(0x17d),_0x5eef82,_0x11ff63?.['error']||'CommHub\x20rejected\x20task',_0x5bf3c5(0x147));else _0x3898ce(_0x5bf3c5(0x17d),null,_0x5bf3c5(0x165),_0x5bf3c5(0x139));}return _0x11ff63;}catch(_0x3e5a7b){throw _0x3898ce('failed',null,_0x3e5a7b,_0x5bf3c5(0x11d)),_0x3e5a7b;}}async function Y(_0x2cc011,_0x477893){const _0x43db6f=a0_0x6aaf68;return X({'fromAlias':_0x2cc011[_0x43db6f(0x119)],'toAlias':_0x2cc011['alias'],'parentTaskId':_0x2cc011['parentTaskId']||null,'networkId':_0x2cc011['networkId']||null,'transport':_0x43db6f(0x126),'lifecycleTracking':'not_tracked'},_0x477893);}class $ extends a0_0x6a1d46{[a0_0x6aaf68(0x127)];['alias'];[a0_0x6aaf68(0x110)];[a0_0x6aaf68(0x13a)];[a0_0x6aaf68(0x114)];['heartbeatInterval'];[a0_0x6aaf68(0x153)];[a0_0x6aaf68(0x104)];[a0_0x6aaf68(0x121)];['running']=!0x1;constructor(_0x18b114){const _0x5b03c3=a0_0x6aaf68;super();if(this[_0x5b03c3(0x127)]=_0x18b114['url'][_0x5b03c3(0x17b)](/\/$/,''),this[_0x5b03c3(0x14f)]=_0x18b114[_0x5b03c3(0x14f)],this[_0x5b03c3(0x110)]=_0x18b114[_0x5b03c3(0x110)],this[_0x5b03c3(0x13a)]=_0x18b114[_0x5b03c3(0x13a)]||_0x5b03c3(0x128),this['resumeId']='sdk-'+_0x18b114[_0x5b03c3(0x14f)]+'-'+Date[_0x5b03c3(0x14b)]()['toString'](0x24),this[_0x5b03c3(0x163)]=_0x18b114[_0x5b03c3(0x163)]??0x2bf20,this[_0x5b03c3(0x153)]=_0x18b114[_0x5b03c3(0x153)]??0xbb8,_0x18b114['autoConnect']!==!0x1)this[_0x5b03c3(0x152)]();}['log'](_0x265353){const _0x4e7127=a0_0x6aaf68;console[_0x4e7127(0x125)]('['+new Date()[_0x4e7127(0x120)]()['slice'](0x0,0x8)+_0x4e7127(0x158)+this[_0x4e7127(0x14f)]+']\x20'+_0x265353);}async[a0_0x6aaf68(0x141)](_0x54aca4,_0x13658e){const _0x11210d=a0_0x6aaf68;let _0x12d13c={'Content-Type':_0x11210d(0x144),'Accept':_0x11210d(0x113)};if(this[_0x11210d(0x110)])_0x12d13c[_0x11210d(0x12a)]='Bearer\x20'+this[_0x11210d(0x110)];let _0x463339=await(await fetch(this[_0x11210d(0x127)]+_0x11210d(0x15f),{'method':'POST','headers':_0x12d13c,'body':JSON['stringify']({'jsonrpc':_0x11210d(0x13d),'id':Date[_0x11210d(0x14b)](),'method':'tools/call','params':{'name':_0x54aca4,'arguments':_0x13658e}})}))[_0x11210d(0x15c)](),_0x190b49=_0x463339['match'](/data: (.+)/),_0x208803=_0x190b49?JSON[_0x11210d(0x124)](_0x190b49[0x1]):JSON['parse'](_0x463339),_0x3d1769=_0x208803?.[_0x11210d(0x118)]?.[_0x11210d(0x117)]?.[0x0]?.[_0x11210d(0x15c)];return _0x3d1769?JSON['parse'](_0x3d1769):_0x208803;}async[a0_0x6aaf68(0x152)](){const _0x137959=a0_0x6aaf68;if(this[_0x137959(0x156)])return;this[_0x137959(0x156)]=!0x0,await this[_0x137959(0x108)](_0x137959(0x129)),this[_0x137959(0x125)](_0x137959(0x177)),this[_0x137959(0x104)]=setInterval(()=>{const _0x543dba=_0x137959;this[_0x543dba(0x108)](_0x543dba(0x129))[_0x543dba(0x146)](_0x3d2770=>this[_0x543dba(0x125)]('heartbeat\x20failed:\x20'+_0x3d2770[_0x543dba(0x109)]));},this[_0x137959(0x163)]),this[_0x137959(0x16c)]();}async['disconnect'](){const _0x52a3b3=a0_0x6aaf68;if(this[_0x52a3b3(0x156)]=!0x1,this[_0x52a3b3(0x121)]?.[_0x52a3b3(0x12f)](),this['heartbeatTimer'])clearInterval(this[_0x52a3b3(0x104)]);await this[_0x52a3b3(0x108)](_0x52a3b3(0x145))[_0x52a3b3(0x146)](()=>{}),this['log']('disconnected');}async[a0_0x6aaf68(0x107)](_0x28d9c6,_0x357ef3,_0x1bd9a0=a0_0x6aaf68(0x162)){const _0x56f280=a0_0x6aaf68;return Y({'alias':_0x28d9c6,'fromAlias':this[_0x56f280(0x14f)]},{'log':_0x45b1f3=>console[_0x56f280(0x125)](_0x45b1f3),'send':()=>this[_0x56f280(0x141)](_0x56f280(0x10f),{'alias':_0x28d9c6,'task':_0x357ef3,'priority':_0x1bd9a0,'from_session':this[_0x56f280(0x14f)]})});}async[a0_0x6aaf68(0x109)](_0x4f7a02,_0x59b68a){const _0x58203d=a0_0x6aaf68;return this['call'](_0x58203d(0x10b),{'alias':_0x4f7a02,'message':_0x59b68a,'from_session':this[_0x58203d(0x14f)]});}async[a0_0x6aaf68(0x142)](_0x116279,_0xa08a94,_0x27c540=a0_0x6aaf68(0x11f)){const _0x2fa480=a0_0x6aaf68;return this['call'](_0x2fa480(0x170),{'in_reply_to':_0x116279,'text':_0xa08a94,'status':_0x27c540});}async[a0_0x6aaf68(0x108)](_0x36d68d,_0x40205d){const _0x4c1eb0=a0_0x6aaf68;return this[_0x4c1eb0(0x141)]('report_status',{'resume_id':this['resumeId'],'alias':this[_0x4c1eb0(0x14f)],'status':_0x36d68d,'server':a0_0x42f55e(),'hostname':a0_0x42f55e(),'agent':this[_0x4c1eb0(0x13a)],'project_dir':process[_0x4c1eb0(0x10a)](),..._0x40205d});}async[a0_0x6aaf68(0x11c)](){const _0x31a75a=a0_0x6aaf68;return this['call'](_0x31a75a(0x180),{});}async['broadcast'](_0x19b07c,_0x3a47cf){const _0x8e2774=a0_0x6aaf68;return this[_0x8e2774(0x141)]('broadcast',{'message':_0x19b07c,'filter_server':_0x3a47cf?.[_0x8e2774(0x116)],'filter_status':_0x3a47cf?.[_0x8e2774(0x108)]});}async[a0_0x6aaf68(0x16c)](){const _0x4e00d4=a0_0x6aaf68;let _0x1c43e3=encodeURIComponent(this[_0x4e00d4(0x14f)]),_0x2d600d=this[_0x4e00d4(0x127)]+_0x4e00d4(0x184)+_0x1c43e3,_0x274a4a=this[_0x4e00d4(0x153)];while(this['running']){try{this['sseAbort']=new AbortController();let _0x2e75f2={'Accept':_0x4e00d4(0x166)};if(this[_0x4e00d4(0x110)])_0x2e75f2[_0x4e00d4(0x12a)]=_0x4e00d4(0x133)+this['token'];let _0x506102=await fetch(_0x2d600d,{'headers':_0x2e75f2,'signal':this[_0x4e00d4(0x121)][_0x4e00d4(0x106)]});if(!_0x506102['ok']||!_0x506102[_0x4e00d4(0x183)]){this['log'](_0x4e00d4(0x13c)+_0x506102[_0x4e00d4(0x108)]),await this[_0x4e00d4(0x11e)](_0x274a4a),_0x274a4a=Math['min'](_0x274a4a*1.5,0xea60);continue;}_0x274a4a=this[_0x4e00d4(0x153)];let _0x1110b9=_0x506102['body'][_0x4e00d4(0x16b)](),_0x2a1b55=new TextDecoder(),_0xef553f='';while(this[_0x4e00d4(0x156)]){let {done:_0x118aba,value:_0x146099}=await _0x1110b9['read']();if(_0x118aba)break;_0xef553f+=_0x2a1b55[_0x4e00d4(0x12b)](_0x146099,{'stream':!0x0});let _0x36af02=_0xef553f[_0x4e00d4(0x168)]('\x0a');_0xef553f=_0x36af02[_0x4e00d4(0x103)]()||'';for(let _0x2738c4 of _0x36af02){if(!_0x2738c4['startsWith'](_0x4e00d4(0x130)))continue;try{let _0x1b9fcf=JSON[_0x4e00d4(0x124)](_0x2738c4[_0x4e00d4(0x112)](0x6));if(_0x1b9fcf['type']===_0x4e00d4(0x12c)){this[_0x4e00d4(0x125)]('SSE\x20connected'),this[_0x4e00d4(0x11a)](_0x4e00d4(0x12c));continue;}if(_0x1b9fcf[_0x4e00d4(0x12d)]===_0x4e00d4(0x154)||_0x1b9fcf[_0x4e00d4(0x12d)]===_0x4e00d4(0x134)||_0x1b9fcf['type']===_0x4e00d4(0x17e))await this[_0x4e00d4(0x160)]();}catch{}}}}catch(_0x20be01){if(_0x20be01[_0x4e00d4(0x16e)]==='AbortError')break;this[_0x4e00d4(0x11a)](_0x4e00d4(0x15e),_0x20be01),this[_0x4e00d4(0x125)](_0x4e00d4(0x15b)+_0x20be01[_0x4e00d4(0x109)]);}if(this[_0x4e00d4(0x156)])this[_0x4e00d4(0x11a)](_0x4e00d4(0x16a)),this['log'](_0x4e00d4(0x150)+_0x274a4a/0x3e8+_0x4e00d4(0x14e)),await this[_0x4e00d4(0x11e)](_0x274a4a),_0x274a4a=Math[_0x4e00d4(0x12e)](_0x274a4a*1.5,0xea60);}}async['processInbox'](){const _0x328800=a0_0x6aaf68;try{let _0x595f07=(await this[_0x328800(0x141)]('get_inbox',{'alias':this[_0x328800(0x14f)],'limit':0xa}))?.[_0x328800(0x159)]||[];for(let _0x3d9882 of _0x595f07)await this['call'](_0x328800(0x13f),{'alias':this[_0x328800(0x14f)],'message_id':_0x3d9882['id']}),this['log']('←\x20'+_0x3d9882['from_session']+':\x20'+_0x3d9882[_0x328800(0x117)][_0x328800(0x112)](0x0,0x3c)),this['emit'](_0x328800(0x140),_0x3d9882),this[_0x328800(0x11a)](_0x328800(0x109),_0x3d9882);}catch(_0xb5667d){this[_0x328800(0x125)](_0x328800(0x148)+_0xb5667d['message']);}}[a0_0x6aaf68(0x11e)](_0x353c33){return new Promise(_0x5a34f4=>setTimeout(_0x5a34f4,_0x353c33));}}var F=$;export{F as default,$ as CommHub};
|
|
1
|
+
const a0_0x550e5e=a0_0x454b;(function(_0x5d3164,_0x248582){const _0x3f1474=a0_0x454b,_0x4354c7=_0x5d3164();while(!![]){try{const _0x23dfc8=-parseInt(_0x3f1474(0xcc))/0x1*(-parseInt(_0x3f1474(0xc3))/0x2)+-parseInt(_0x3f1474(0x96))/0x3+-parseInt(_0x3f1474(0x82))/0x4*(parseInt(_0x3f1474(0x74))/0x5)+-parseInt(_0x3f1474(0xae))/0x6+parseInt(_0x3f1474(0xee))/0x7*(parseInt(_0x3f1474(0xa2))/0x8)+parseInt(_0x3f1474(0xcf))/0x9*(-parseInt(_0x3f1474(0xa8))/0xa)+parseInt(_0x3f1474(0xb6))/0xb*(parseInt(_0x3f1474(0xc8))/0xc);if(_0x23dfc8===_0x248582)break;else _0x4354c7['push'](_0x4354c7['shift']());}catch(_0x4692ba){_0x4354c7['push'](_0x4354c7['shift']());}}}(a0_0x5bad,0x8120f));function a0_0x454b(_0x2bc4d,_0x28d04b){_0x2bc4d=_0x2bc4d-0x6e;const _0x5badd4=a0_0x5bad();let _0x454b5f=_0x5badd4[_0x2bc4d];return _0x454b5f;}import{EventEmitter as a0_0x4da2cc}from'events';import{hostname as a0_0xeea49b}from'os';var K=/(?:atok|ntok|utok|ghp|github_pat)_[A-Za-z0-9_-]+|Bearer\s+\S+/gi,L=(_0xd9073e,_0x356d19)=>(_0xd9073e??_0x356d19)[a0_0x550e5e(0xeb)](/[\r\n\x00-\x1f\x7f]/g,'\x20')[a0_0x550e5e(0xc0)](0x0,0xf0);function N(_0x46f4ba){const _0x21280f=a0_0x550e5e;return(_0x46f4ba instanceof Error?_0x46f4ba[_0x21280f(0xea)]:String(_0x46f4ba??_0x21280f(0x7c)))[_0x21280f(0xeb)](K,_0x21280f(0xbf))[_0x21280f(0xeb)](/[\r\n\x00-\x1f\x7f]/g,'\x20')[_0x21280f(0xc0)](0x0,0xf0);}function O(_0xb049e9,_0x2f9c94=process.env.ANET_TASK_TRACE_FORMAT==='json'){const _0x38c803=a0_0x550e5e;if(_0x2f9c94)return JSON[_0x38c803(0xb9)](_0xb049e9);let _0xaf8946=L(_0xb049e9[_0x38c803(0x70)],'<missing>'),_0x89adbf=L(_0xb049e9[_0x38c803(0xc2)],_0x38c803(0x88)),_0x32e7bb=_0xb049e9[_0x38c803(0xe1)]?_0x38c803(0xe9)+_0xb049e9[_0x38c803(0xe1)]+':'+(_0xb049e9[_0x38c803(0xe3)]??''):'';return _0x38c803(0xcb)+_0xb049e9[_0x38c803(0xb8)]+_0x38c803(0xd3)+L(_0xb049e9[_0x38c803(0xb5)],_0x38c803(0xa3))+_0x38c803(0x84)+L(_0xb049e9['to_alias'],_0x38c803(0xa3))+'\x20task_id='+_0x89adbf+_0x38c803(0x98)+_0xaf8946+'\x20network_id='+L(_0xb049e9['network_id'],_0x38c803(0xa3))+_0x38c803(0x86)+_0xb049e9['transport']+'\x20duration_ms='+_0xb049e9[_0x38c803(0xc4)]+_0x38c803(0x8d)+_0xb049e9['lifecycle_tracking']+_0x32e7bb;}function U(_0x503960){const _0x4dace1=a0_0x550e5e;return{'event':{'sending':_0x4dace1(0x8f),'delivered':_0x4dace1(0xdc),'failed':_0x4dace1(0xe4),'acked':_0x4dace1(0x6e),'started':_0x4dace1(0x97),'replied':'task.replied','expired':_0x4dace1(0xc7)}[_0x503960[_0x4dace1(0xb8)]],..._0x503960};}function j(_0xd3cc25){const _0x27c330=a0_0x550e5e;let _0x3716be=_0xd3cc25?.[_0x27c330(0xc2)]||_0xd3cc25?.[_0x27c330(0xd0)]||_0xd3cc25?.['id'];if(_0x3716be)return String(_0x3716be);let _0x4e816b=_0xd3cc25?.['content']?.[0x0]?.[_0x27c330(0xad)];if(typeof _0x4e816b!==_0x27c330(0xd4))return null;try{let _0x38bf7f=JSON[_0x27c330(0xac)](_0x4e816b);return _0x38bf7f?.[_0x27c330(0xc2)]||_0x38bf7f?.['message_id']||_0x38bf7f?.['id']||null;}catch{return null;}}async function X(_0xbaac3a,_0x49f54d){const _0x5cee60=a0_0x550e5e;let _0x12d832=_0x49f54d[_0x5cee60(0x94)]??Date['now'],_0x5b8476=_0x12d832(),_0x2303ae=(_0x46dd14,_0x3bbc57,_0x41be2e,_0x361df9)=>{const _0x34e931=_0x5cee60;_0x49f54d[_0x34e931(0x8c)](O(U({'from_alias':_0xbaac3a[_0x34e931(0x80)],'to_alias':_0xbaac3a[_0x34e931(0xc9)],'task_id':_0x3bbc57,'parent_task_id':_0xbaac3a[_0x34e931(0x7f)],'network_id':_0xbaac3a[_0x34e931(0x76)],'transport':_0xbaac3a[_0x34e931(0x79)],'status':_0x46dd14,'duration_ms':_0x12d832()-_0x5b8476,'lifecycle_tracking':_0xbaac3a[_0x34e931(0x83)],..._0x41be2e!==void 0x0?{'error_code':_0x361df9||_0x34e931(0xaa),'error_message':N(_0x41be2e)}:{}})));};_0x2303ae(_0x5cee60(0x9b),null);try{let _0xc6a566=await _0x49f54d[_0x5cee60(0x71)](),_0x552c89=j(_0xc6a566);if(_0x552c89)_0x2303ae(_0x5cee60(0x9f),_0x552c89);else{if(_0xc6a566?.['ok']===!0x1||_0xc6a566?.['error'])_0x2303ae('failed',_0x552c89,_0xc6a566?.[_0x5cee60(0xd8)]||_0x5cee60(0xb1),'send_rejected');else _0x2303ae(_0x5cee60(0xe0),null,_0x5cee60(0xa4),_0x5cee60(0x93));}return _0xc6a566;}catch(_0x4342e8){throw _0x2303ae(_0x5cee60(0xe0),null,_0x4342e8,_0x5cee60(0xaa)),_0x4342e8;}}async function Y(_0x402f9e,_0x5c12fd){const _0x85688c=a0_0x550e5e;return X({'fromAlias':_0x402f9e[_0x85688c(0x80)],'toAlias':_0x402f9e[_0x85688c(0x7d)],'parentTaskId':_0x402f9e[_0x85688c(0x7f)]||null,'networkId':_0x402f9e[_0x85688c(0x76)]||null,'transport':_0x85688c(0xd7),'lifecycleTracking':_0x85688c(0xa5)},_0x5c12fd);}class $ extends a0_0x4da2cc{['url'];[a0_0x550e5e(0x7d)];['token'];['agent'];[a0_0x550e5e(0x99)];[a0_0x550e5e(0xa0)];[a0_0x550e5e(0xd2)];[a0_0x550e5e(0x9d)];[a0_0x550e5e(0xce)];[a0_0x550e5e(0xd1)]=!0x1;constructor(_0x223f70){const _0x55d00a=a0_0x550e5e;super();if(this[_0x55d00a(0x92)]=_0x223f70[_0x55d00a(0x92)][_0x55d00a(0xeb)](/\/$/,''),this['alias']=_0x223f70[_0x55d00a(0x7d)],this[_0x55d00a(0xdb)]=_0x223f70[_0x55d00a(0xdb)],this[_0x55d00a(0x7a)]=_0x223f70[_0x55d00a(0x7a)]||_0x55d00a(0x91),this[_0x55d00a(0x99)]=_0x55d00a(0xc1)+_0x223f70[_0x55d00a(0x7d)]+'-'+Date[_0x55d00a(0x94)]()[_0x55d00a(0xdd)](0x24),this[_0x55d00a(0xa0)]=_0x223f70[_0x55d00a(0xa0)]??0x2bf20,this[_0x55d00a(0xd2)]=_0x223f70['reconnectDelay']??0xbb8,_0x223f70[_0x55d00a(0x72)]!==!0x1)this[_0x55d00a(0x89)]();}[a0_0x550e5e(0x8c)](_0x413b6b){const _0x568a2a=a0_0x550e5e;console[_0x568a2a(0x8c)]('['+new Date()[_0x568a2a(0xe6)]()[_0x568a2a(0xc0)](0x0,0x8)+_0x568a2a(0x73)+this[_0x568a2a(0x7d)]+']\x20'+_0x413b6b);}async[a0_0x550e5e(0xbe)](_0x5ac407,_0x315820){const _0x307eea=a0_0x550e5e;let _0x168ee8={'Content-Type':'application/json','Accept':'application/json,\x20text/event-stream'};if(this[_0x307eea(0xdb)])_0x168ee8[_0x307eea(0x75)]=_0x307eea(0xb3)+this[_0x307eea(0xdb)];let _0xc85a33=await(await fetch(this[_0x307eea(0x92)]+'/mcp',{'method':'POST','headers':_0x168ee8,'body':JSON[_0x307eea(0xb9)]({'jsonrpc':_0x307eea(0xbb),'id':Date[_0x307eea(0x94)](),'method':_0x307eea(0x7b),'params':{'name':_0x5ac407,'arguments':_0x315820}})}))[_0x307eea(0xad)](),_0x160ca6=_0xc85a33['match'](/data: (.+)/),_0x1dc06a=_0x160ca6?JSON[_0x307eea(0xac)](_0x160ca6[0x1]):JSON[_0x307eea(0xac)](_0xc85a33),_0xdc0f8c=_0x1dc06a?.[_0x307eea(0xcd)]?.['content']?.[0x0]?.[_0x307eea(0xad)];return _0xdc0f8c?JSON['parse'](_0xdc0f8c):_0x1dc06a;}async[a0_0x550e5e(0x89)](){const _0x597786=a0_0x550e5e;if(this[_0x597786(0xd1)])return;this['running']=!0x0,await this[_0x597786(0xb8)](_0x597786(0x9e)),this[_0x597786(0x8c)](_0x597786(0xc5)),this[_0x597786(0x9d)]=setInterval(()=>{const _0x242951=_0x597786;this[_0x242951(0xb8)](_0x242951(0x9e))['catch'](_0x50ebc6=>this[_0x242951(0x8c)]('heartbeat\x20failed:\x20'+_0x50ebc6[_0x242951(0xea)]));},this[_0x597786(0xa0)]),this[_0x597786(0xd6)]();}async[a0_0x550e5e(0xc6)](){const _0x5d6fbd=a0_0x550e5e;if(this[_0x5d6fbd(0xd1)]=!0x1,this['sseAbort']?.['abort'](),this[_0x5d6fbd(0x9d)])clearInterval(this['heartbeatTimer']);await this[_0x5d6fbd(0xb8)](_0x5d6fbd(0xbc))[_0x5d6fbd(0x81)](()=>{}),this['log']('disconnected');}async[a0_0x550e5e(0x71)](_0x3860a4,_0x31e0a8,_0x2f7e94=a0_0x550e5e(0x90)){const _0x44634e=a0_0x550e5e;return Y({'alias':_0x3860a4,'fromAlias':this['alias']},{'log':_0x67e2e4=>console[_0x44634e(0x8c)](_0x67e2e4),'send':()=>this[_0x44634e(0xbe)]('send_task',{'alias':_0x3860a4,'task':_0x31e0a8,'priority':_0x2f7e94,'from_session':this['alias']})});}async[a0_0x550e5e(0xea)](_0x434d91,_0x2f1b56){const _0x2155b7=a0_0x550e5e;return this['call']('send_message',{'alias':_0x434d91,'message':_0x2f1b56,'from_session':this[_0x2155b7(0x7d)]});}async[a0_0x550e5e(0x9a)](_0x147d74,_0x451bea,_0x12c0c5=a0_0x550e5e(0xb2)){const _0x577287=a0_0x550e5e;return this['call'](_0x577287(0xde),{'in_reply_to':_0x147d74,'text':_0x451bea,'status':_0x12c0c5});}async[a0_0x550e5e(0xb8)](_0x2060d4,_0x18096b){const _0x31143b=a0_0x550e5e;return this[_0x31143b(0xbe)](_0x31143b(0xbd),{'resume_id':this['resumeId'],'alias':this[_0x31143b(0x7d)],'status':_0x2060d4,'server':a0_0xeea49b(),'hostname':a0_0xeea49b(),'agent':this[_0x31143b(0x7a)],'project_dir':process[_0x31143b(0xa9)](),..._0x18096b});}async['getAllStatus'](){const _0x1e7bf8=a0_0x550e5e;return this[_0x1e7bf8(0xbe)](_0x1e7bf8(0xa6),{});}async['broadcast'](_0x394916,_0x11212a){const _0x31df29=a0_0x550e5e;return this[_0x31df29(0xbe)](_0x31df29(0xab),{'message':_0x394916,'filter_server':_0x11212a?.[_0x31df29(0x85)],'filter_status':_0x11212a?.[_0x31df29(0xb8)]});}async[a0_0x550e5e(0xd6)](){const _0x4c37f6=a0_0x550e5e;let _0x4c3cd2=encodeURIComponent(this[_0x4c37f6(0x7d)]),_0x2aba8e=this[_0x4c37f6(0x92)]+_0x4c37f6(0xa7)+_0x4c3cd2,_0x4d40c6=this[_0x4c37f6(0xd2)];while(this[_0x4c37f6(0xd1)]){try{this['sseAbort']=new AbortController();let _0x475615={'Accept':'text/event-stream'};if(this['token'])_0x475615[_0x4c37f6(0x75)]=_0x4c37f6(0xb3)+this[_0x4c37f6(0xdb)];let _0x2519f6=await fetch(_0x2aba8e,{'headers':_0x475615,'signal':this[_0x4c37f6(0xce)][_0x4c37f6(0xb4)]});if(!_0x2519f6['ok']||!_0x2519f6['body']){this['log'](_0x4c37f6(0x7e)+_0x2519f6[_0x4c37f6(0xb8)]),await this[_0x4c37f6(0xd9)](_0x4d40c6),_0x4d40c6=Math[_0x4c37f6(0xdf)](_0x4d40c6*1.5,0xea60);continue;}_0x4d40c6=this[_0x4c37f6(0xd2)];let _0x5cef41=_0x2519f6[_0x4c37f6(0xa1)]['getReader'](),_0x5877df=new TextDecoder(),_0x5754c4='';while(this['running']){let {done:_0x236d6a,value:_0x37fb7c}=await _0x5cef41[_0x4c37f6(0xda)]();if(_0x236d6a)break;_0x5754c4+=_0x5877df['decode'](_0x37fb7c,{'stream':!0x0});let _0x15f31c=_0x5754c4[_0x4c37f6(0xe5)]('\x0a');_0x5754c4=_0x15f31c[_0x4c37f6(0xed)]()||'';for(let _0x2cdfa5 of _0x15f31c){if(!_0x2cdfa5['startsWith'](_0x4c37f6(0x6f)))continue;try{let _0x3ffab6=JSON[_0x4c37f6(0xac)](_0x2cdfa5['slice'](0x6));if(_0x3ffab6[_0x4c37f6(0xe7)]==='connected'){this[_0x4c37f6(0x8c)](_0x4c37f6(0xd5)),this[_0x4c37f6(0xb7)](_0x4c37f6(0xb0));continue;}if(_0x3ffab6[_0x4c37f6(0xe7)]===_0x4c37f6(0x77)||_0x3ffab6[_0x4c37f6(0xe7)]==='new_message'||_0x3ffab6['type']===_0x4c37f6(0xab))await this['processInbox']();}catch{}}}}catch(_0x1bd23e){if(_0x1bd23e[_0x4c37f6(0x87)]===_0x4c37f6(0xca))break;this[_0x4c37f6(0xb7)](_0x4c37f6(0xd8),_0x1bd23e),this[_0x4c37f6(0x8c)](_0x4c37f6(0x8b)+_0x1bd23e[_0x4c37f6(0xea)]);}if(this[_0x4c37f6(0xd1)])this[_0x4c37f6(0xb7)](_0x4c37f6(0x8e)),this[_0x4c37f6(0x8c)](_0x4c37f6(0xec)+_0x4d40c6/0x3e8+_0x4c37f6(0xaf)),await this[_0x4c37f6(0xd9)](_0x4d40c6),_0x4d40c6=Math[_0x4c37f6(0xdf)](_0x4d40c6*1.5,0xea60);}}async[a0_0x550e5e(0xba)](){const _0x50cf57=a0_0x550e5e;try{let _0x5a459d=(await this[_0x50cf57(0xbe)](_0x50cf57(0xe8),{'alias':this[_0x50cf57(0x7d)],'limit':0xa}))?.[_0x50cf57(0x8a)]||[];for(let _0x135885 of _0x5a459d)await this[_0x50cf57(0xbe)]('ack_inbox',{'alias':this['alias'],'message_id':_0x135885['id']}),this[_0x50cf57(0x8c)]('←\x20'+_0x135885[_0x50cf57(0x9c)]+':\x20'+_0x135885[_0x50cf57(0x78)][_0x50cf57(0xc0)](0x0,0x3c)),this[_0x50cf57(0xb7)](_0x50cf57(0x95),_0x135885),this[_0x50cf57(0xb7)](_0x50cf57(0xea),_0x135885);}catch(_0x1d6555){this[_0x50cf57(0x8c)](_0x50cf57(0xe2)+_0x1d6555[_0x50cf57(0xea)]);}}['sleep'](_0x567be2){return new Promise(_0x3e8e32=>setTimeout(_0x3e8e32,_0x567be2));}}var F=$;export{F as default,$ as CommHub};function a0_0x5bad(){const _0x1e5dcf=['CommHub\x20response\x20omitted\x20task_id','not_tracked','get_all_status','/events/','10190kBgzlD','cwd','send_failed','broadcast','parse','text','4581036MmNpDD','s...','connected','CommHub\x20rejected\x20task','completed','Bearer\x20','signal','from_alias','11FXhjQk','emit','status','stringify','processInbox','2.0','offline','report_status','call','[REDACTED]','slice','sdk-','task_id','905758VWETMy','duration_ms','registered','disconnect','task.expired','12978924lRQwpV','toAlias','AbortError','[commhub:task]\x20','2TudWVK','result','sseAbort','8757hCdqkb','message_id','running','reconnectDelay','\x20from=','string','SSE\x20connected','connectSSE','mcp_http','error','sleep','read','token','task.send.delivered','toString','send_reply','min','failed','error_code','inbox\x20error:\x20','error_message','task.send.failed','split','toTimeString','type','get_inbox','\x20error=','message','replace','SSE\x20reconnecting\x20in\x20','pop','7FxncUR','task.ack','data:\x20','parent_task_id','send','autoConnect',']\x20[commhub:','306635KSSUFa','Authorization','networkId','new_task','content','transport','agent','tools/call','unknown\x20error','alias','SSE\x20failed:\x20','parentTaskId','fromAlias','catch','4YrlMob','lifecycleTracking','\x20to=','server','\x20transport=','name','<pending>','connect','messages','SSE\x20error:\x20','log','\x20lifecycle=','disconnected','task.send.start','normal','sdk','url','missing_task_id','now','task','960780qByoeM','task.started','\x20parent_task_id=','resumeId','reply','sending','from_session','heartbeatTimer','idle','delivered','heartbeatInterval','body','5425248YGkeuV','<unknown>'];a0_0x5bad=function(){return _0x1e5dcf;};return a0_0x5bad();}
|
|
@@ -73,7 +73,9 @@ export declare function exactSessionRows(rows: readonly {
|
|
|
73
73
|
* process's /proc/<pid>/cmdline — only the config path does.
|
|
74
74
|
*/
|
|
75
75
|
export declare function tokenInSessionSnippet(configPath: string, jsRuntime: string): string;
|
|
76
|
-
|
|
76
|
+
/** Same token handoff, via the standalone binary's internal argv (it is not `node -e`). */
|
|
77
|
+
export declare function standaloneBinTokenSnippet(configPath: string, anetBin: string): string;
|
|
78
|
+
export declare function appserverShellCommand(plan: ExternalAppserverPlan, jsRuntime: string, mode?: "js-eval" | "standalone-bin"): string;
|
|
77
79
|
/**
|
|
78
80
|
* Board #734 — `codex --version` with the app-server pane's exact preamble (workspace
|
|
79
81
|
* .env sourced the same way, same CODEX_HOME), run with `bash -c` like the pane, so the
|
|
@@ -2,11 +2,41 @@
|
|
|
2
2
|
export declare function resolveDaemonProviderTarget(nodesDir: string, target: {
|
|
3
3
|
node_id: string;
|
|
4
4
|
alias: string;
|
|
5
|
-
}, networkId: string): {
|
|
5
|
+
}, networkId: string, readOnly?: boolean): {
|
|
6
6
|
dir: string;
|
|
7
7
|
config: Record<string, any>;
|
|
8
8
|
};
|
|
9
|
-
export declare function scanDaemonCodex(nodesDir: string, targets: unknown, networkId: string, hostHome?: string): {
|
|
9
|
+
export declare function scanDaemonCodex(nodesDir: string, targets: unknown, networkId: string, hostHome?: string, discoverLocal?: boolean): {
|
|
10
|
+
observed_at: number;
|
|
11
|
+
scope: string;
|
|
12
|
+
rows: ({
|
|
13
|
+
status: string;
|
|
14
|
+
node_id: any;
|
|
15
|
+
alias: any;
|
|
16
|
+
} | {
|
|
17
|
+
node_configured_model: string | null;
|
|
18
|
+
config_revision: string | null;
|
|
19
|
+
config_status: string;
|
|
20
|
+
configured_provider: string | null;
|
|
21
|
+
configured_model: string | null;
|
|
22
|
+
provider_ids: string[];
|
|
23
|
+
auth_kind: string;
|
|
24
|
+
credential_status: string;
|
|
25
|
+
account_fingerprint: string | null;
|
|
26
|
+
verification: string;
|
|
27
|
+
effective_state: string;
|
|
28
|
+
status: string;
|
|
29
|
+
runtime: string | null;
|
|
30
|
+
home_ref: string;
|
|
31
|
+
home_source: string;
|
|
32
|
+
node_id: any;
|
|
33
|
+
alias: any;
|
|
34
|
+
})[];
|
|
35
|
+
} | {
|
|
36
|
+
local_discovery: {
|
|
37
|
+
status: string;
|
|
38
|
+
rows: any[];
|
|
39
|
+
};
|
|
10
40
|
observed_at: number;
|
|
11
41
|
scope: string;
|
|
12
42
|
rows: ({
|
|
@@ -2,6 +2,8 @@ import { DaemonProviderStore } from './daemon-provider-store';
|
|
|
2
2
|
export declare function providerNodeRevision(nodeDir: string): string;
|
|
3
3
|
export declare function readProviderNodeConfig(nodeDir: string): Record<string, any>;
|
|
4
4
|
export declare function readProviderNodeToml(nodeDir: string): import("smol-toml").TomlTable;
|
|
5
|
+
/** Private, local configured credentials only. Never inherit the caller's env. */
|
|
6
|
+
export declare function readProviderNodeEnv(nodeDir: string): Record<string, string>;
|
|
5
7
|
export type ProviderApplicationRequest = {
|
|
6
8
|
requestId: string;
|
|
7
9
|
networkId: string;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { DaemonProviderStore } from './daemon-provider-store';
|
|
2
|
+
import { type ProviderCollection } from './shared/provider-collection';
|
|
3
|
+
export { validProviderCollection, type ProviderCollection } from './shared/provider-collection';
|
|
4
|
+
/** Hub transport must authorize/revalidate binding before invoking this local
|
|
5
|
+
* operation. Local CLI users explicitly select an owned registry identity. */
|
|
6
|
+
export declare function collectDaemonProvider(nodesDir: string, store: DaemonProviderStore, selection: ProviderCollection, revision: number, requestId?: string): {
|
|
7
|
+
revision: number;
|
|
8
|
+
source: "daemon";
|
|
9
|
+
providers: {
|
|
10
|
+
id: string;
|
|
11
|
+
label: string;
|
|
12
|
+
enabled: boolean;
|
|
13
|
+
runtimes: {
|
|
14
|
+
runtime: "codex-tui";
|
|
15
|
+
auth: {
|
|
16
|
+
credential_present: boolean;
|
|
17
|
+
verification: "not_checked";
|
|
18
|
+
application: "not_applied";
|
|
19
|
+
account_id?: string | undefined;
|
|
20
|
+
baseUrl?: string | undefined;
|
|
21
|
+
id: string;
|
|
22
|
+
kind: import("./daemon-provider-store").ProviderAuthKind;
|
|
23
|
+
models: string[];
|
|
24
|
+
}[];
|
|
25
|
+
}[];
|
|
26
|
+
}[];
|
|
27
|
+
network_id: string;
|
|
28
|
+
daemon_node_id: string;
|
|
29
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const DAEMON_PROVIDER_USAGE = "anet daemon provider <list|scan|put|apply> <daemon> [--revision N] [--request dps_UUID] (put/scan/apply read private JSON from stdin; no key in argv)";
|
|
1
|
+
export declare const DAEMON_PROVIDER_USAGE = "anet daemon provider <list|scan|put|collect|apply|initialize> <daemon> [--revision N] [--request dps_UUID] (put/collect/scan/apply/initialize read private JSON from stdin; no key in argv)";
|
|
2
2
|
export declare function readProviderInput(fd?: number): string;
|
|
3
3
|
export declare function runDaemonProvider(args: string[], deps: {
|
|
4
4
|
nodesDir: string;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { DaemonProviderStore } from './daemon-provider-store';
|
|
2
|
+
import { type ProviderInitialization } from './shared/provider-initialization';
|
|
3
|
+
type Request = {
|
|
4
|
+
request_id: string;
|
|
5
|
+
alias: string;
|
|
6
|
+
network_id: string;
|
|
7
|
+
daemon_node_id: string;
|
|
8
|
+
selection: ProviderInitialization;
|
|
9
|
+
};
|
|
10
|
+
export declare function initializeDaemonProvider(nodesDir: string, store: DaemonProviderStore, request: Request): Promise<{
|
|
11
|
+
status: string;
|
|
12
|
+
request_id: string;
|
|
13
|
+
node_id: string;
|
|
14
|
+
provider_revision: number;
|
|
15
|
+
provider_id: string;
|
|
16
|
+
auth_id: string;
|
|
17
|
+
model: string;
|
|
18
|
+
runtime_provider: string;
|
|
19
|
+
node_revision: string;
|
|
20
|
+
verification: string;
|
|
21
|
+
}>;
|
|
22
|
+
export declare function runDaemonProviderInitialize(args: string[], deps: {
|
|
23
|
+
nodesDir: string;
|
|
24
|
+
readInput: () => string;
|
|
25
|
+
print: (text: string) => void;
|
|
26
|
+
}): Promise<number>;
|
|
27
|
+
export {};
|