@sleep2agi/agent-network 2.3.0-preview.165 → 2.3.0-preview.167
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-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_0x2c82ce=a0_0x2207;(function(_0x55ec80,_0x5aafb8){const _0x40febc=a0_0x2207,_0x5838b0=_0x55ec80();while(!![]){try{const _0x5917d4=-parseInt(_0x40febc(0x120))/0x1*(-parseInt(_0x40febc(0x10c))/0x2)+-parseInt(_0x40febc(0x11d))/0x3*(parseInt(_0x40febc(0x154))/0x4)+-parseInt(_0x40febc(0x171))/0x5*(-parseInt(_0x40febc(0x146))/0x6)+parseInt(_0x40febc(0x14c))/0x7+-parseInt(_0x40febc(0x166))/0x8*(-parseInt(_0x40febc(0x174))/0x9)+-parseInt(_0x40febc(0x13f))/0xa+parseInt(_0x40febc(0x170))/0xb*(-parseInt(_0x40febc(0x145))/0xc);if(_0x5917d4===_0x5aafb8)break;else _0x5838b0['push'](_0x5838b0['shift']());}catch(_0x564951){_0x5838b0['push'](_0x5838b0['shift']());}}}(a0_0x6803,0x9a076));import{EventEmitter as a0_0x52b4f9}from'events';import{hostname as a0_0x31dd76}from'os';var K=/(?:atok|ntok|utok|ghp|github_pat)_[A-Za-z0-9_-]+|Bearer\s+\S+/gi,L=(_0x13a04f,_0x4978d7)=>(_0x13a04f??_0x4978d7)['replace'](/[\r\n\x00-\x1f\x7f]/g,'\x20')[a0_0x2c82ce(0x134)](0x0,0xf0);function N(_0x9c2f4a){const _0x3d27cd=a0_0x2c82ce;return(_0x9c2f4a instanceof Error?_0x9c2f4a['message']:String(_0x9c2f4a??_0x3d27cd(0x180)))['replace'](K,'[REDACTED]')['replace'](/[\r\n\x00-\x1f\x7f]/g,'\x20')[_0x3d27cd(0x134)](0x0,0xf0);}function O(_0x7c58,_0x51f86a=process.env.ANET_TASK_TRACE_FORMAT==='json'){const _0x19f8bc=a0_0x2c82ce;if(_0x51f86a)return JSON[_0x19f8bc(0x162)](_0x7c58);let _0x60f5f4=L(_0x7c58['parent_task_id'],_0x19f8bc(0x12f)),_0x59a726=L(_0x7c58['task_id'],'<pending>'),_0x4f6688=_0x7c58['error_code']?_0x19f8bc(0x15f)+_0x7c58[_0x19f8bc(0x157)]+':'+(_0x7c58['error_message']??''):'';return'[commhub:task]\x20'+_0x7c58[_0x19f8bc(0x15e)]+_0x19f8bc(0x14e)+L(_0x7c58['from_alias'],_0x19f8bc(0x187))+'\x20to='+L(_0x7c58[_0x19f8bc(0x12c)],_0x19f8bc(0x187))+_0x19f8bc(0x136)+_0x59a726+_0x19f8bc(0x189)+_0x60f5f4+_0x19f8bc(0x179)+L(_0x7c58[_0x19f8bc(0x156)],_0x19f8bc(0x187))+_0x19f8bc(0x13e)+_0x7c58['transport']+'\x20duration_ms='+_0x7c58['duration_ms']+_0x19f8bc(0x17b)+_0x7c58['lifecycle_tracking']+_0x4f6688;}function U(_0x5ab22e){const _0x57f796=a0_0x2c82ce;return{'event':{'sending':_0x57f796(0x128),'delivered':_0x57f796(0x175),'failed':'task.send.failed','acked':_0x57f796(0x130),'started':'task.started','replied':_0x57f796(0x151),'expired':'task.expired'}[_0x5ab22e[_0x57f796(0x15e)]],..._0x5ab22e};}function j(_0x34e828){const _0x49895a=a0_0x2c82ce;let _0x1efc74=_0x34e828?.[_0x49895a(0x159)]||_0x34e828?.[_0x49895a(0x112)]||_0x34e828?.['id'];if(_0x1efc74)return String(_0x1efc74);let _0xcbe0e9=_0x34e828?.[_0x49895a(0x14f)]?.[0x0]?.[_0x49895a(0x169)];if(typeof _0xcbe0e9!==_0x49895a(0x143))return null;try{let _0x23bcd7=JSON[_0x49895a(0x11e)](_0xcbe0e9);return _0x23bcd7?.[_0x49895a(0x159)]||_0x23bcd7?.[_0x49895a(0x112)]||_0x23bcd7?.['id']||null;}catch{return null;}}function a0_0x6803(){const _0x4570f5=['split','network_id','error_code','parentTaskId','task_id','url','fromAlias','cwd','disconnected','status','\x20error=','POST','toString','stringify','SSE\x20connected','getReader','autoConnect','37704HzcgzV','server','match','text','result','log','heartbeat\x20failed:\x20','toTimeString','startsWith','running','27085355yDhRXi','15rybCSi','missing_task_id',']\x20[commhub:','2178aBwFiX','task.send.delivered','not_tracked','SSE\x20reconnecting\x20in\x20','AbortError','\x20network_id=','failed','\x20lifecycle=','/events/','replace','new_message','sleep','unknown\x20error','call','transport','Bearer\x20','sdk','s...','2.0','<unknown>','offline','\x20parent_task_id=','name','resumeId','13276ETUbEP','from_session','get_inbox','sdk-','reply','delivered','message_id','emit','Authorization','toAlias','idle','connectSSE','mcp_http','body','CommHub\x20response\x20omitted\x20task_id','send_task','agent','3gHUAFd','parse','token','145DgrxsC','sseAbort','messages','report_status','broadcast','application/json','ack_inbox','send_reply','task.send.start','task','connect','heartbeatTimer','to_alias','inbox\x20error:\x20','networkId','<missing>','task.ack','getAllStatus','registered','catch','slice','lifecycleTracking','\x20task_id=','tools/call','reconnectDelay','alias','min','CommHub\x20rejected\x20task','heartbeatInterval','now','\x20transport=','6091640oqfwbH','send_failed','message','error','string','connected','12CYEAPF','1096380tsoTgx','disconnect','send','get_all_status','data:\x20','processInbox','8023190QEvfJr','application/json,\x20text/event-stream','\x20from=','content','type','task.replied','text/event-stream','normal','380180zmVZJJ'];a0_0x6803=function(){return _0x4570f5;};return a0_0x6803();}async function X(_0x3bae77,_0x30d6b6){const _0x1ba7fe=a0_0x2c82ce;let _0x39c38c=_0x30d6b6[_0x1ba7fe(0x13d)]??Date[_0x1ba7fe(0x13d)],_0x2b7b41=_0x39c38c(),_0x417c2b=(_0x5bf20c,_0x27a226,_0x3e4cf0,_0x406697)=>{const _0x101e4c=_0x1ba7fe;_0x30d6b6['log'](O(U({'from_alias':_0x3bae77[_0x101e4c(0x15b)],'to_alias':_0x3bae77[_0x101e4c(0x115)],'task_id':_0x27a226,'parent_task_id':_0x3bae77[_0x101e4c(0x158)],'network_id':_0x3bae77['networkId'],'transport':_0x3bae77[_0x101e4c(0x182)],'status':_0x5bf20c,'duration_ms':_0x39c38c()-_0x2b7b41,'lifecycle_tracking':_0x3bae77[_0x101e4c(0x135)],..._0x3e4cf0!==void 0x0?{'error_code':_0x406697||_0x101e4c(0x140),'error_message':N(_0x3e4cf0)}:{}})));};_0x417c2b('sending',null);try{let _0x34f4ef=await _0x30d6b6[_0x1ba7fe(0x148)](),_0x5b3b01=j(_0x34f4ef);if(_0x5b3b01)_0x417c2b(_0x1ba7fe(0x111),_0x5b3b01);else{if(_0x34f4ef?.['ok']===!0x1||_0x34f4ef?.[_0x1ba7fe(0x142)])_0x417c2b(_0x1ba7fe(0x17a),_0x5b3b01,_0x34f4ef?.[_0x1ba7fe(0x142)]||_0x1ba7fe(0x13b),'send_rejected');else _0x417c2b(_0x1ba7fe(0x17a),null,_0x1ba7fe(0x11a),_0x1ba7fe(0x172));}return _0x34f4ef;}catch(_0x2242df){throw _0x417c2b('failed',null,_0x2242df,_0x1ba7fe(0x140)),_0x2242df;}}async function Y(_0x2f9d69,_0x50bb3c){const _0x604ccc=a0_0x2c82ce;return X({'fromAlias':_0x2f9d69[_0x604ccc(0x15b)],'toAlias':_0x2f9d69[_0x604ccc(0x139)],'parentTaskId':_0x2f9d69[_0x604ccc(0x158)]||null,'networkId':_0x2f9d69[_0x604ccc(0x12e)]||null,'transport':_0x604ccc(0x118),'lifecycleTracking':_0x604ccc(0x176)},_0x50bb3c);}function a0_0x2207(_0x3d6d8a,_0x2b1048){_0x3d6d8a=_0x3d6d8a-0x10b;const _0x68038c=a0_0x6803();let _0x220745=_0x68038c[_0x3d6d8a];return _0x220745;}class $ extends a0_0x52b4f9{['url'];[a0_0x2c82ce(0x139)];['token'];['agent'];[a0_0x2c82ce(0x10b)];[a0_0x2c82ce(0x13c)];[a0_0x2c82ce(0x138)];[a0_0x2c82ce(0x12b)];[a0_0x2c82ce(0x121)];[a0_0x2c82ce(0x16f)]=!0x1;constructor(_0x116b64){const _0x50bf08=a0_0x2c82ce;super();if(this[_0x50bf08(0x15a)]=_0x116b64[_0x50bf08(0x15a)][_0x50bf08(0x17d)](/\/$/,''),this[_0x50bf08(0x139)]=_0x116b64[_0x50bf08(0x139)],this[_0x50bf08(0x11f)]=_0x116b64[_0x50bf08(0x11f)],this[_0x50bf08(0x11c)]=_0x116b64[_0x50bf08(0x11c)]||_0x50bf08(0x184),this[_0x50bf08(0x10b)]=_0x50bf08(0x10f)+_0x116b64[_0x50bf08(0x139)]+'-'+Date['now']()[_0x50bf08(0x161)](0x24),this['heartbeatInterval']=_0x116b64[_0x50bf08(0x13c)]??0x2bf20,this[_0x50bf08(0x138)]=_0x116b64[_0x50bf08(0x138)]??0xbb8,_0x116b64[_0x50bf08(0x165)]!==!0x1)this[_0x50bf08(0x12a)]();}[a0_0x2c82ce(0x16b)](_0x2ee1ed){const _0x2e2f5e=a0_0x2c82ce;console[_0x2e2f5e(0x16b)]('['+new Date()[_0x2e2f5e(0x16d)]()['slice'](0x0,0x8)+_0x2e2f5e(0x173)+this['alias']+']\x20'+_0x2ee1ed);}async['call'](_0x5b5de4,_0x410de9){const _0xb10d45=a0_0x2c82ce;let _0x4c3d1a={'Content-Type':_0xb10d45(0x125),'Accept':_0xb10d45(0x14d)};if(this[_0xb10d45(0x11f)])_0x4c3d1a[_0xb10d45(0x114)]=_0xb10d45(0x183)+this['token'];let _0x3f6a29=await(await fetch(this[_0xb10d45(0x15a)]+'/mcp',{'method':_0xb10d45(0x160),'headers':_0x4c3d1a,'body':JSON[_0xb10d45(0x162)]({'jsonrpc':_0xb10d45(0x186),'id':Date[_0xb10d45(0x13d)](),'method':_0xb10d45(0x137),'params':{'name':_0x5b5de4,'arguments':_0x410de9}})}))[_0xb10d45(0x169)](),_0x25afbe=_0x3f6a29[_0xb10d45(0x168)](/data: (.+)/),_0x164848=_0x25afbe?JSON[_0xb10d45(0x11e)](_0x25afbe[0x1]):JSON['parse'](_0x3f6a29),_0x53ba25=_0x164848?.[_0xb10d45(0x16a)]?.['content']?.[0x0]?.['text'];return _0x53ba25?JSON[_0xb10d45(0x11e)](_0x53ba25):_0x164848;}async[a0_0x2c82ce(0x12a)](){const _0x48d81e=a0_0x2c82ce;if(this['running'])return;this['running']=!0x0,await this['status'](_0x48d81e(0x116)),this['log'](_0x48d81e(0x132)),this[_0x48d81e(0x12b)]=setInterval(()=>{const _0x2b965e=_0x48d81e;this['status'](_0x2b965e(0x116))[_0x2b965e(0x133)](_0x15ac62=>this[_0x2b965e(0x16b)](_0x2b965e(0x16c)+_0x15ac62[_0x2b965e(0x141)]));},this[_0x48d81e(0x13c)]),this[_0x48d81e(0x117)]();}async[a0_0x2c82ce(0x147)](){const _0x534699=a0_0x2c82ce;if(this['running']=!0x1,this['sseAbort']?.['abort'](),this[_0x534699(0x12b)])clearInterval(this['heartbeatTimer']);await this[_0x534699(0x15e)](_0x534699(0x188))[_0x534699(0x133)](()=>{}),this['log'](_0x534699(0x15d));}async[a0_0x2c82ce(0x148)](_0xcdf594,_0x226aa7,_0x90d6b4=a0_0x2c82ce(0x153)){const _0x4ecafb=a0_0x2c82ce;return Y({'alias':_0xcdf594,'fromAlias':this[_0x4ecafb(0x139)]},{'log':_0x438bda=>console[_0x4ecafb(0x16b)](_0x438bda),'send':()=>this[_0x4ecafb(0x181)](_0x4ecafb(0x11b),{'alias':_0xcdf594,'task':_0x226aa7,'priority':_0x90d6b4,'from_session':this['alias']})});}async[a0_0x2c82ce(0x141)](_0x3d9ee1,_0x400323){return this['call']('send_message',{'alias':_0x3d9ee1,'message':_0x400323,'from_session':this['alias']});}async[a0_0x2c82ce(0x110)](_0x31f816,_0x3d2495,_0x4a403b='completed'){const _0x2970e3=a0_0x2c82ce;return this[_0x2970e3(0x181)](_0x2970e3(0x127),{'in_reply_to':_0x31f816,'text':_0x3d2495,'status':_0x4a403b});}async[a0_0x2c82ce(0x15e)](_0x17cf14,_0x3b90db){const _0x584923=a0_0x2c82ce;return this[_0x584923(0x181)](_0x584923(0x123),{'resume_id':this['resumeId'],'alias':this[_0x584923(0x139)],'status':_0x17cf14,'server':a0_0x31dd76(),'hostname':a0_0x31dd76(),'agent':this[_0x584923(0x11c)],'project_dir':process[_0x584923(0x15c)](),..._0x3b90db});}async[a0_0x2c82ce(0x131)](){const _0x1e5673=a0_0x2c82ce;return this[_0x1e5673(0x181)](_0x1e5673(0x149),{});}async[a0_0x2c82ce(0x124)](_0x567b86,_0xb8bd79){const _0x10f891=a0_0x2c82ce;return this['call']('broadcast',{'message':_0x567b86,'filter_server':_0xb8bd79?.[_0x10f891(0x167)],'filter_status':_0xb8bd79?.[_0x10f891(0x15e)]});}async[a0_0x2c82ce(0x117)](){const _0x56ecaa=a0_0x2c82ce;let _0x523709=encodeURIComponent(this['alias']),_0x554093=this['url']+_0x56ecaa(0x17c)+_0x523709,_0x409a15=this[_0x56ecaa(0x138)];while(this['running']){try{this[_0x56ecaa(0x121)]=new AbortController();let _0x468f56={'Accept':_0x56ecaa(0x152)};if(this['token'])_0x468f56['Authorization']=_0x56ecaa(0x183)+this['token'];let _0x5d3e1b=await fetch(_0x554093,{'headers':_0x468f56,'signal':this['sseAbort']['signal']});if(!_0x5d3e1b['ok']||!_0x5d3e1b[_0x56ecaa(0x119)]){this[_0x56ecaa(0x16b)]('SSE\x20failed:\x20'+_0x5d3e1b['status']),await this['sleep'](_0x409a15),_0x409a15=Math['min'](_0x409a15*1.5,0xea60);continue;}_0x409a15=this[_0x56ecaa(0x138)];let _0x1c5a76=_0x5d3e1b['body'][_0x56ecaa(0x164)](),_0x308ab1=new TextDecoder(),_0x381597='';while(this['running']){let {done:_0x3e2a01,value:_0x130c9c}=await _0x1c5a76['read']();if(_0x3e2a01)break;_0x381597+=_0x308ab1['decode'](_0x130c9c,{'stream':!0x0});let _0x2aeafe=_0x381597[_0x56ecaa(0x155)]('\x0a');_0x381597=_0x2aeafe['pop']()||'';for(let _0x1de552 of _0x2aeafe){if(!_0x1de552[_0x56ecaa(0x16e)](_0x56ecaa(0x14a)))continue;try{let _0x4c6355=JSON[_0x56ecaa(0x11e)](_0x1de552[_0x56ecaa(0x134)](0x6));if(_0x4c6355[_0x56ecaa(0x150)]==='connected'){this['log'](_0x56ecaa(0x163)),this['emit'](_0x56ecaa(0x144));continue;}if(_0x4c6355[_0x56ecaa(0x150)]==='new_task'||_0x4c6355[_0x56ecaa(0x150)]===_0x56ecaa(0x17e)||_0x4c6355[_0x56ecaa(0x150)]===_0x56ecaa(0x124))await this['processInbox']();}catch{}}}}catch(_0x145d8b){if(_0x145d8b[_0x56ecaa(0x18a)]===_0x56ecaa(0x178))break;this[_0x56ecaa(0x113)](_0x56ecaa(0x142),_0x145d8b),this[_0x56ecaa(0x16b)]('SSE\x20error:\x20'+_0x145d8b[_0x56ecaa(0x141)]);}if(this['running'])this['emit'](_0x56ecaa(0x15d)),this[_0x56ecaa(0x16b)](_0x56ecaa(0x177)+_0x409a15/0x3e8+_0x56ecaa(0x185)),await this[_0x56ecaa(0x17f)](_0x409a15),_0x409a15=Math[_0x56ecaa(0x13a)](_0x409a15*1.5,0xea60);}}async[a0_0x2c82ce(0x14b)](){const _0xfecb54=a0_0x2c82ce;try{let _0x381530=(await this[_0xfecb54(0x181)](_0xfecb54(0x10e),{'alias':this[_0xfecb54(0x139)],'limit':0xa}))?.[_0xfecb54(0x122)]||[];for(let _0x44ddc1 of _0x381530)await this[_0xfecb54(0x181)](_0xfecb54(0x126),{'alias':this[_0xfecb54(0x139)],'message_id':_0x44ddc1['id']}),this[_0xfecb54(0x16b)]('←\x20'+_0x44ddc1[_0xfecb54(0x10d)]+':\x20'+_0x44ddc1[_0xfecb54(0x14f)][_0xfecb54(0x134)](0x0,0x3c)),this[_0xfecb54(0x113)](_0xfecb54(0x129),_0x44ddc1),this['emit'](_0xfecb54(0x141),_0x44ddc1);}catch(_0x539151){this[_0xfecb54(0x16b)](_0xfecb54(0x12d)+_0x539151['message']);}}['sleep'](_0x4d10d7){return new Promise(_0x582f0d=>setTimeout(_0x582f0d,_0x4d10d7));}}var F=$;export{F as default,$ as CommHub};
|
|
1
|
+
const a0_0x5bf240=a0_0xe272;function a0_0x4afb(){const _0x44d283=['89288yXqeWk','failed','disconnected','\x20task_id=','\x20network_id=','content','connectSSE','sdk-','slice','stringify','now','get_all_status','sending','idle','<unknown>','4Ikxkje','3841797GnoJCy','json','SSE\x20reconnecting\x20in\x20','broadcast','ack_inbox','messages','url','parent_task_id','emit','task.send.failed','registered','processInbox','text','getReader','lifecycle_tracking','name','min','get_inbox','[commhub:task]\x20','type','Authorization','send_task','send_rejected','call','agent','to_alias','connect','delivered','CommHub\x20response\x20omitted\x20task_id','\x20error=','2.0','catch','autoConnect','replace','lifecycleTracking','new_message','task.replied','task_id','task.started','SSE\x20connected','7258730SdmOXF','alias','application/json,\x20text/event-stream','disconnect','\x20transport=','2787936HWocMo','fromAlias','pop','from_session','74047HqldRa','heartbeatInterval','task','\x20duration_ms=','/events/','error','running','parentTaskId','body','parse','log','send_message','<missing>','send_failed','POST','token','abort','/mcp','\x20lifecycle=','error_code','task.ack','\x20parent_task_id=','reply','task.expired','completed','unknown\x20error','reconnectDelay','status','signal','duration_ms','31831540EZyGeX','getAllStatus','Bearer\x20','network_id','<pending>','text/event-stream','heartbeatTimer','AbortError','toAlias','networkId','report_status','sleep','read','startsWith','CommHub\x20rejected\x20task','558CwnyRR','[REDACTED]','\x20from=','send','toTimeString','resumeId','s...','new_task','from_alias','message_id','normal','data:\x20','sseAbort','6826225QmTDda','12oxCbbx',']\x20[commhub:','tools/call','message','mcp_http','connected','match'];a0_0x4afb=function(){return _0x44d283;};return a0_0x4afb();}(function(_0x1f14d6,_0x397f1a){const _0xfe3dd2=a0_0xe272,_0x57460b=_0x1f14d6();while(!![]){try{const _0x5130d2=-parseInt(_0xfe3dd2(0x14e))/0x1*(parseInt(_0xfe3dd2(0x106))/0x2)+-parseInt(_0xfe3dd2(0x11d))/0x3*(parseInt(_0xfe3dd2(0x11c))/0x4)+parseInt(_0xfe3dd2(0x145))/0x5+-parseInt(_0xfe3dd2(0x14a))/0x6+-parseInt(_0xfe3dd2(0x105))/0x7+parseInt(_0xfe3dd2(0x10d))/0x8*(-parseInt(_0xfe3dd2(0xf8))/0x9)+parseInt(_0xfe3dd2(0x16c))/0xa;if(_0x5130d2===_0x397f1a)break;else _0x57460b['push'](_0x57460b['shift']());}catch(_0x25d146){_0x57460b['push'](_0x57460b['shift']());}}}(a0_0x4afb,0xbdfde));import{EventEmitter as a0_0x27b2f7}from'events';import{hostname as a0_0x386df4}from'os';var K=/(?:atok|ntok|utok|ghp|github_pat)_[A-Za-z0-9_-]+|Bearer\s+\S+/gi,L=(_0x11df3d,_0x56dac0)=>(_0x11df3d??_0x56dac0)[a0_0x5bf240(0x13e)](/[\r\n\x00-\x1f\x7f]/g,'\x20')[a0_0x5bf240(0x115)](0x0,0xf0);function N(_0x2b4557){const _0x4b2304=a0_0x5bf240;return(_0x2b4557 instanceof Error?_0x2b4557['message']:String(_0x2b4557??_0x4b2304(0x167)))['replace'](K,_0x4b2304(0xf9))['replace'](/[\r\n\x00-\x1f\x7f]/g,'\x20')[_0x4b2304(0x115)](0x0,0xf0);}function O(_0x393b53,_0x27bb21=process.env.ANET_TASK_TRACE_FORMAT===a0_0x5bf240(0x11e)){const _0x51b279=a0_0x5bf240;if(_0x27bb21)return JSON[_0x51b279(0x116)](_0x393b53);let _0x5e1a78=L(_0x393b53[_0x51b279(0x124)],_0x51b279(0x15a)),_0x463f27=L(_0x393b53[_0x51b279(0x142)],_0x51b279(0x170)),_0x4daddd=_0x393b53['error_code']?_0x51b279(0x13a)+_0x393b53[_0x51b279(0x161)]+':'+(_0x393b53['error_message']??''):'';return _0x51b279(0x12f)+_0x393b53[_0x51b279(0x169)]+_0x51b279(0xfa)+L(_0x393b53[_0x51b279(0x100)],_0x51b279(0x11b))+'\x20to='+L(_0x393b53[_0x51b279(0x136)],_0x51b279(0x11b))+_0x51b279(0x110)+_0x463f27+_0x51b279(0x163)+_0x5e1a78+_0x51b279(0x111)+L(_0x393b53[_0x51b279(0x16f)],_0x51b279(0x11b))+_0x51b279(0x149)+_0x393b53['transport']+_0x51b279(0x151)+_0x393b53[_0x51b279(0x16b)]+_0x51b279(0x160)+_0x393b53[_0x51b279(0x12b)]+_0x4daddd;}function a0_0xe272(_0x1b28d2,_0x5dfa3a){_0x1b28d2=_0x1b28d2-0xf3;const _0x4afbe1=a0_0x4afb();let _0xe272ff=_0x4afbe1[_0x1b28d2];return _0xe272ff;}function U(_0x5afb4d){const _0x5c1044=a0_0x5bf240;return{'event':{'sending':'task.send.start','delivered':'task.send.delivered','failed':_0x5c1044(0x126),'acked':_0x5c1044(0x162),'started':_0x5c1044(0x143),'replied':_0x5c1044(0x141),'expired':_0x5c1044(0x165)}[_0x5afb4d['status']],..._0x5afb4d};}function j(_0xf6f309){const _0x171882=a0_0x5bf240;let _0x1eb0cb=_0xf6f309?.[_0x171882(0x142)]||_0xf6f309?.[_0x171882(0x101)]||_0xf6f309?.['id'];if(_0x1eb0cb)return String(_0x1eb0cb);let _0x5855de=_0xf6f309?.[_0x171882(0x112)]?.[0x0]?.['text'];if(typeof _0x5855de!=='string')return null;try{let _0x2f8980=JSON[_0x171882(0x157)](_0x5855de);return _0x2f8980?.['task_id']||_0x2f8980?.[_0x171882(0x101)]||_0x2f8980?.['id']||null;}catch{return null;}}async function X(_0x590cca,_0x510f4a){const _0x1bf2e6=a0_0x5bf240;let _0x7a7940=_0x510f4a['now']??Date[_0x1bf2e6(0x117)],_0x139580=_0x7a7940(),_0x26615a=(_0x733abd,_0x12aada,_0x301440,_0xb82330)=>{const _0x41299b=_0x1bf2e6;_0x510f4a[_0x41299b(0x158)](O(U({'from_alias':_0x590cca[_0x41299b(0x14b)],'to_alias':_0x590cca[_0x41299b(0x174)],'task_id':_0x12aada,'parent_task_id':_0x590cca[_0x41299b(0x155)],'network_id':_0x590cca[_0x41299b(0x175)],'transport':_0x590cca['transport'],'status':_0x733abd,'duration_ms':_0x7a7940()-_0x139580,'lifecycle_tracking':_0x590cca[_0x41299b(0x13f)],..._0x301440!==void 0x0?{'error_code':_0xb82330||_0x41299b(0x15b),'error_message':N(_0x301440)}:{}})));};_0x26615a(_0x1bf2e6(0x119),null);try{let _0x48a846=await _0x510f4a[_0x1bf2e6(0xfb)](),_0x517a2f=j(_0x48a846);if(_0x517a2f)_0x26615a(_0x1bf2e6(0x138),_0x517a2f);else{if(_0x48a846?.['ok']===!0x1||_0x48a846?.[_0x1bf2e6(0x153)])_0x26615a(_0x1bf2e6(0x10e),_0x517a2f,_0x48a846?.[_0x1bf2e6(0x153)]||_0x1bf2e6(0xf7),_0x1bf2e6(0x133));else _0x26615a('failed',null,_0x1bf2e6(0x139),'missing_task_id');}return _0x48a846;}catch(_0x3bbaf5){throw _0x26615a(_0x1bf2e6(0x10e),null,_0x3bbaf5,'send_failed'),_0x3bbaf5;}}async function Y(_0x14d735,_0x784e13){const _0x352cc1=a0_0x5bf240;return X({'fromAlias':_0x14d735[_0x352cc1(0x14b)],'toAlias':_0x14d735['alias'],'parentTaskId':_0x14d735['parentTaskId']||null,'networkId':_0x14d735[_0x352cc1(0x175)]||null,'transport':_0x352cc1(0x10a),'lifecycleTracking':'not_tracked'},_0x784e13);}class $ extends a0_0x27b2f7{[a0_0x5bf240(0x123)];[a0_0x5bf240(0x146)];[a0_0x5bf240(0x15d)];[a0_0x5bf240(0x135)];['resumeId'];['heartbeatInterval'];[a0_0x5bf240(0x168)];[a0_0x5bf240(0x172)];[a0_0x5bf240(0x104)];['running']=!0x1;constructor(_0x181673){const _0x498efe=a0_0x5bf240;super();if(this[_0x498efe(0x123)]=_0x181673[_0x498efe(0x123)][_0x498efe(0x13e)](/\/$/,''),this[_0x498efe(0x146)]=_0x181673[_0x498efe(0x146)],this[_0x498efe(0x15d)]=_0x181673['token'],this[_0x498efe(0x135)]=_0x181673[_0x498efe(0x135)]||'sdk',this[_0x498efe(0xfd)]=_0x498efe(0x114)+_0x181673[_0x498efe(0x146)]+'-'+Date['now']()['toString'](0x24),this[_0x498efe(0x14f)]=_0x181673[_0x498efe(0x14f)]??0x2bf20,this[_0x498efe(0x168)]=_0x181673[_0x498efe(0x168)]??0xbb8,_0x181673[_0x498efe(0x13d)]!==!0x1)this[_0x498efe(0x137)]();}[a0_0x5bf240(0x158)](_0x158e65){const _0x46f393=a0_0x5bf240;console[_0x46f393(0x158)]('['+new Date()[_0x46f393(0xfc)]()['slice'](0x0,0x8)+_0x46f393(0x107)+this[_0x46f393(0x146)]+']\x20'+_0x158e65);}async['call'](_0x1fc303,_0x15e6c4){const _0x1ded1b=a0_0x5bf240;let _0x954f91={'Content-Type':'application/json','Accept':_0x1ded1b(0x147)};if(this[_0x1ded1b(0x15d)])_0x954f91['Authorization']=_0x1ded1b(0x16e)+this['token'];let _0x33d706=await(await fetch(this['url']+_0x1ded1b(0x15f),{'method':_0x1ded1b(0x15c),'headers':_0x954f91,'body':JSON['stringify']({'jsonrpc':_0x1ded1b(0x13b),'id':Date['now'](),'method':_0x1ded1b(0x108),'params':{'name':_0x1fc303,'arguments':_0x15e6c4}})}))[_0x1ded1b(0x129)](),_0x408c30=_0x33d706[_0x1ded1b(0x10c)](/data: (.+)/),_0x6e0d15=_0x408c30?JSON[_0x1ded1b(0x157)](_0x408c30[0x1]):JSON[_0x1ded1b(0x157)](_0x33d706),_0x5f097a=_0x6e0d15?.['result']?.['content']?.[0x0]?.[_0x1ded1b(0x129)];return _0x5f097a?JSON[_0x1ded1b(0x157)](_0x5f097a):_0x6e0d15;}async[a0_0x5bf240(0x137)](){const _0x1c516e=a0_0x5bf240;if(this['running'])return;this[_0x1c516e(0x154)]=!0x0,await this['status']('idle'),this[_0x1c516e(0x158)](_0x1c516e(0x127)),this['heartbeatTimer']=setInterval(()=>{const _0x3deaed=_0x1c516e;this[_0x3deaed(0x169)](_0x3deaed(0x11a))[_0x3deaed(0x13c)](_0x3a4008=>this[_0x3deaed(0x158)]('heartbeat\x20failed:\x20'+_0x3a4008[_0x3deaed(0x109)]));},this[_0x1c516e(0x14f)]),this['connectSSE']();}async[a0_0x5bf240(0x148)](){const _0xe247b2=a0_0x5bf240;if(this[_0xe247b2(0x154)]=!0x1,this[_0xe247b2(0x104)]?.[_0xe247b2(0x15e)](),this[_0xe247b2(0x172)])clearInterval(this[_0xe247b2(0x172)]);await this['status']('offline')[_0xe247b2(0x13c)](()=>{}),this[_0xe247b2(0x158)]('disconnected');}async[a0_0x5bf240(0xfb)](_0x207f4a,_0x579908,_0x280b5b=a0_0x5bf240(0x102)){const _0x11cbb7=a0_0x5bf240;return Y({'alias':_0x207f4a,'fromAlias':this['alias']},{'log':_0x20d01b=>console[_0x11cbb7(0x158)](_0x20d01b),'send':()=>this[_0x11cbb7(0x134)](_0x11cbb7(0x132),{'alias':_0x207f4a,'task':_0x579908,'priority':_0x280b5b,'from_session':this['alias']})});}async[a0_0x5bf240(0x109)](_0x2f02d0,_0x5e49d6){const _0x11e4f4=a0_0x5bf240;return this['call'](_0x11e4f4(0x159),{'alias':_0x2f02d0,'message':_0x5e49d6,'from_session':this[_0x11e4f4(0x146)]});}async[a0_0x5bf240(0x164)](_0x2b6b7a,_0x4297b5,_0x25336c=a0_0x5bf240(0x166)){const _0x2c2f32=a0_0x5bf240;return this[_0x2c2f32(0x134)]('send_reply',{'in_reply_to':_0x2b6b7a,'text':_0x4297b5,'status':_0x25336c});}async['status'](_0x3544b3,_0x593f7d){const _0x5858a1=a0_0x5bf240;return this[_0x5858a1(0x134)](_0x5858a1(0xf3),{'resume_id':this[_0x5858a1(0xfd)],'alias':this[_0x5858a1(0x146)],'status':_0x3544b3,'server':a0_0x386df4(),'hostname':a0_0x386df4(),'agent':this[_0x5858a1(0x135)],'project_dir':process['cwd'](),..._0x593f7d});}async[a0_0x5bf240(0x16d)](){const _0x4f958d=a0_0x5bf240;return this[_0x4f958d(0x134)](_0x4f958d(0x118),{});}async[a0_0x5bf240(0x120)](_0x25f107,_0x522cb6){const _0x3015c4=a0_0x5bf240;return this[_0x3015c4(0x134)](_0x3015c4(0x120),{'message':_0x25f107,'filter_server':_0x522cb6?.['server'],'filter_status':_0x522cb6?.[_0x3015c4(0x169)]});}async[a0_0x5bf240(0x113)](){const _0x255bb4=a0_0x5bf240;let _0x5331ac=encodeURIComponent(this[_0x255bb4(0x146)]),_0x1510de=this['url']+_0x255bb4(0x152)+_0x5331ac,_0x556d9a=this[_0x255bb4(0x168)];while(this[_0x255bb4(0x154)]){try{this[_0x255bb4(0x104)]=new AbortController();let _0x17f23d={'Accept':_0x255bb4(0x171)};if(this[_0x255bb4(0x15d)])_0x17f23d[_0x255bb4(0x131)]=_0x255bb4(0x16e)+this['token'];let _0xb3543b=await fetch(_0x1510de,{'headers':_0x17f23d,'signal':this['sseAbort'][_0x255bb4(0x16a)]});if(!_0xb3543b['ok']||!_0xb3543b[_0x255bb4(0x156)]){this[_0x255bb4(0x158)]('SSE\x20failed:\x20'+_0xb3543b[_0x255bb4(0x169)]),await this[_0x255bb4(0xf4)](_0x556d9a),_0x556d9a=Math[_0x255bb4(0x12d)](_0x556d9a*1.5,0xea60);continue;}_0x556d9a=this[_0x255bb4(0x168)];let _0xa288bf=_0xb3543b[_0x255bb4(0x156)][_0x255bb4(0x12a)](),_0x4f3784=new TextDecoder(),_0x1979d1='';while(this[_0x255bb4(0x154)]){let {done:_0x1c87c3,value:_0x301819}=await _0xa288bf[_0x255bb4(0xf5)]();if(_0x1c87c3)break;_0x1979d1+=_0x4f3784['decode'](_0x301819,{'stream':!0x0});let _0xaacc53=_0x1979d1['split']('\x0a');_0x1979d1=_0xaacc53[_0x255bb4(0x14c)]()||'';for(let _0x56b652 of _0xaacc53){if(!_0x56b652[_0x255bb4(0xf6)](_0x255bb4(0x103)))continue;try{let _0x22b530=JSON[_0x255bb4(0x157)](_0x56b652[_0x255bb4(0x115)](0x6));if(_0x22b530['type']===_0x255bb4(0x10b)){this['log'](_0x255bb4(0x144)),this[_0x255bb4(0x125)](_0x255bb4(0x10b));continue;}if(_0x22b530[_0x255bb4(0x130)]===_0x255bb4(0xff)||_0x22b530[_0x255bb4(0x130)]===_0x255bb4(0x140)||_0x22b530['type']==='broadcast')await this[_0x255bb4(0x128)]();}catch{}}}}catch(_0x436f79){if(_0x436f79[_0x255bb4(0x12c)]===_0x255bb4(0x173))break;this[_0x255bb4(0x125)](_0x255bb4(0x153),_0x436f79),this[_0x255bb4(0x158)]('SSE\x20error:\x20'+_0x436f79[_0x255bb4(0x109)]);}if(this[_0x255bb4(0x154)])this['emit'](_0x255bb4(0x10f)),this[_0x255bb4(0x158)](_0x255bb4(0x11f)+_0x556d9a/0x3e8+_0x255bb4(0xfe)),await this[_0x255bb4(0xf4)](_0x556d9a),_0x556d9a=Math[_0x255bb4(0x12d)](_0x556d9a*1.5,0xea60);}}async['processInbox'](){const _0x209845=a0_0x5bf240;try{let _0x36873a=(await this[_0x209845(0x134)](_0x209845(0x12e),{'alias':this['alias'],'limit':0xa}))?.[_0x209845(0x122)]||[];for(let _0x5f2d0e of _0x36873a)await this[_0x209845(0x134)](_0x209845(0x121),{'alias':this['alias'],'message_id':_0x5f2d0e['id']}),this['log']('←\x20'+_0x5f2d0e[_0x209845(0x14d)]+':\x20'+_0x5f2d0e['content'][_0x209845(0x115)](0x0,0x3c)),this[_0x209845(0x125)](_0x209845(0x150),_0x5f2d0e),this[_0x209845(0x125)]('message',_0x5f2d0e);}catch(_0x12db17){this[_0x209845(0x158)]('inbox\x20error:\x20'+_0x12db17[_0x209845(0x109)]);}}[a0_0x5bf240(0xf4)](_0x31694f){return new Promise(_0x29c293=>setTimeout(_0x29c293,_0x31694f));}}var F=$;export{F as default,$ as CommHub};
|
|
@@ -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,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 {};
|