@sleep2agi/agent-network 2.3.0-preview.156 → 2.3.0-preview.157
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-copresence-env.d.ts +5 -0
- package/dist/src/codex-copresence-recovery.d.ts +9 -0
- package/dist/src/codex-copresence-resume-timeout.d.ts +28 -0
- package/dist/src/codex-copresence-rpc.d.ts +12 -0
- package/dist/src/codex-pending-thread-restart.d.ts +15 -1
- package/dist/src/codex-recovery-resource-gate.d.ts +15 -0
- package/dist/src/im/feishu/worker.js +1 -1
- package/dist/src/node-server.js +8 -8
- package/dist/src/opencode-agent-node-pair.d.ts +6 -6
- package/dist/src/posix-codex-copresence.d.ts +0 -2
- package/dist/src/shared/reserved-env.d.ts +3 -0
- package/dist/src/start-resource-gate.d.ts +146 -0
- package/package.json +4 -2
package/dist/src/client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a0_0x42246c=a0_0x3ddc;(function(_0x4b3d82,_0x46aa53){const _0x5d4a50=a0_0x3ddc,_0x140c67=_0x4b3d82();while(!![]){try{const _0x41a55a=-parseInt(_0x5d4a50(0x124))/0x1*(parseInt(_0x5d4a50(0x118))/0x2)+-parseInt(_0x5d4a50(0x140))/0x3+-parseInt(_0x5d4a50(0x170))/0x4+parseInt(_0x5d4a50(0x171))/0x5*(-parseInt(_0x5d4a50(0x177))/0x6)+-parseInt(_0x5d4a50(0x117))/0x7*(-parseInt(_0x5d4a50(0x16e))/0x8)+parseInt(_0x5d4a50(0x12b))/0x9*(parseInt(_0x5d4a50(0x149))/0xa)+-parseInt(_0x5d4a50(0x108))/0xb*(-parseInt(_0x5d4a50(0x11f))/0xc);if(_0x41a55a===_0x46aa53)break;else _0x140c67['push'](_0x140c67['shift']());}catch(_0x90312e){_0x140c67['push'](_0x140c67['shift']());}}}(a0_0x3212,0x4a104));import{EventEmitter as a0_0x614c1b}from'events';import{hostname as a0_0x55d1c0}from'os';var K=/(?:atok|ntok|utok|ghp|github_pat)_[A-Za-z0-9_-]+|Bearer\s+\S+/gi,L=(_0x33a5a9,_0x335236)=>(_0x33a5a9??_0x335236)[a0_0x42246c(0x147)](/[\r\n\x00-\x1f\x7f]/g,'\x20')[a0_0x42246c(0x154)](0x0,0xf0);function a0_0x3212(){const _0x538509=['Authorization','2.0','task.expired','SSE\x20connected','12dBtfxv','min','missing_task_id','networkId','toTimeString','1gLvyIW','/mcp','data:\x20','not_tracked','heartbeat\x20failed:\x20','get_inbox','<pending>','63zaxxAO','task.ack','task.replied','send_failed','read','resumeId','connectSSE','\x20from=','status','broadcast','task.send.start','autoConnect','abort','sseAbort','running','offline','sdk-','now','error','duration_ms','messages','1749009wlJpjJ','text/event-stream','task.send.delivered','log','sdk','fromAlias','startsWith','replace','CommHub\x20response\x20omitted\x20task_id','553390nsUaTg','alias','signal','\x20network_id=','sending','\x20parent_task_id=','/events/','heartbeatInterval','send_task','cwd','toAlias','slice','task_id','\x20task_id=','connect','idle','POST','reply','send_message','type','unknown\x20error','send','getReader','reconnectDelay','mcp_http','parent_task_id','message','string','inbox\x20error:\x20','\x20to=','from_session','delivered','lifecycleTracking','disconnected','processInbox','<missing>','send_reply','7352DTVJpB','tools/call','833104GufFLv','47485WnuNfD','Bearer\x20','s...','content','body','match','6NWcIAV','sleep','name','disconnect','report_status','url','text','agent','emit','application/json,\x20text/event-stream','getAllStatus','registered','network_id','send_rejected','parentTaskId','token','parse','connected','6444317bpRwqz','decode','stringify','server','ack_inbox','call','transport','\x20error=','heartbeatTimer','error_code','catch','failed','<unknown>','AbortError','lifecycle_tracking','4501Oeurve','919994EOULeG','error_message','task.send.failed'];a0_0x3212=function(){return _0x538509;};return a0_0x3212();}function N(_0x45fd27){const _0x1c0cff=a0_0x42246c;return(_0x45fd27 instanceof Error?_0x45fd27[_0x1c0cff(0x163)]:String(_0x45fd27??_0x1c0cff(0x15d)))[_0x1c0cff(0x147)](K,'[REDACTED]')[_0x1c0cff(0x147)](/[\r\n\x00-\x1f\x7f]/g,'\x20')[_0x1c0cff(0x154)](0x0,0xf0);}function a0_0x3ddc(_0xa368f0,_0x26db90){_0xa368f0=_0xa368f0-0xff;const _0x3212ad=a0_0x3212();let _0x3ddc8f=_0x3212ad[_0xa368f0];return _0x3ddc8f;}function O(_0x17a6c4,_0x366d06=process.env.ANET_TASK_TRACE_FORMAT==='json'){const _0x558257=a0_0x42246c;if(_0x366d06)return JSON[_0x558257(0x10a)](_0x17a6c4);let _0x4389b9=L(_0x17a6c4[_0x558257(0x162)],_0x558257(0x16c)),_0x142c25=L(_0x17a6c4[_0x558257(0x155)],_0x558257(0x12a)),_0x48ab33=_0x17a6c4['error_code']?_0x558257(0x10f)+_0x17a6c4[_0x558257(0x111)]+':'+(_0x17a6c4[_0x558257(0x119)]??''):'';return'[commhub:task]\x20'+_0x17a6c4['status']+_0x558257(0x132)+L(_0x17a6c4['from_alias'],_0x558257(0x114))+_0x558257(0x166)+L(_0x17a6c4['to_alias'],_0x558257(0x114))+_0x558257(0x156)+_0x142c25+_0x558257(0x14e)+_0x4389b9+_0x558257(0x14c)+L(_0x17a6c4[_0x558257(0x102)],_0x558257(0x114))+'\x20transport='+_0x17a6c4[_0x558257(0x10e)]+'\x20duration_ms='+_0x17a6c4[_0x558257(0x13e)]+'\x20lifecycle='+_0x17a6c4[_0x558257(0x116)]+_0x48ab33;}function U(_0x4425a7){const _0x151bae=a0_0x42246c;return{'event':{'sending':_0x151bae(0x135),'delivered':_0x151bae(0x142),'failed':_0x151bae(0x11a),'acked':_0x151bae(0x12c),'started':'task.started','replied':_0x151bae(0x12d),'expired':_0x151bae(0x11d)}[_0x4425a7['status']],..._0x4425a7};}function j(_0x334ac2){const _0xf36363=a0_0x42246c;let _0x2161a7=_0x334ac2?.[_0xf36363(0x155)]||_0x334ac2?.['message_id']||_0x334ac2?.['id'];if(_0x2161a7)return String(_0x2161a7);let _0x5523b9=_0x334ac2?.['content']?.[0x0]?.[_0xf36363(0x17d)];if(typeof _0x5523b9!==_0xf36363(0x164))return null;try{let _0x82ca17=JSON[_0xf36363(0x106)](_0x5523b9);return _0x82ca17?.[_0xf36363(0x155)]||_0x82ca17?.['message_id']||_0x82ca17?.['id']||null;}catch{return null;}}async function X(_0x55403d,_0x4d2fb9){const _0x95c17f=a0_0x42246c;let _0x3442ac=_0x4d2fb9[_0x95c17f(0x13c)]??Date[_0x95c17f(0x13c)],_0x5c9970=_0x3442ac(),_0x179d85=(_0xbdb02b,_0x429e94,_0x5979f2,_0x5b761a)=>{const _0x268b5b=_0x95c17f;_0x4d2fb9[_0x268b5b(0x143)](O(U({'from_alias':_0x55403d[_0x268b5b(0x145)],'to_alias':_0x55403d[_0x268b5b(0x153)],'task_id':_0x429e94,'parent_task_id':_0x55403d[_0x268b5b(0x104)],'network_id':_0x55403d[_0x268b5b(0x122)],'transport':_0x55403d['transport'],'status':_0xbdb02b,'duration_ms':_0x3442ac()-_0x5c9970,'lifecycle_tracking':_0x55403d[_0x268b5b(0x169)],..._0x5979f2!==void 0x0?{'error_code':_0x5b761a||_0x268b5b(0x12e),'error_message':N(_0x5979f2)}:{}})));};_0x179d85(_0x95c17f(0x14d),null);try{let _0x3bcb66=await _0x4d2fb9[_0x95c17f(0x15e)](),_0x5d2ae2=j(_0x3bcb66);if(_0x5d2ae2)_0x179d85(_0x95c17f(0x168),_0x5d2ae2);else{if(_0x3bcb66?.['ok']===!0x1||_0x3bcb66?.[_0x95c17f(0x13d)])_0x179d85(_0x95c17f(0x113),_0x5d2ae2,_0x3bcb66?.[_0x95c17f(0x13d)]||'CommHub\x20rejected\x20task',_0x95c17f(0x103));else _0x179d85('failed',null,_0x95c17f(0x148),_0x95c17f(0x121));}return _0x3bcb66;}catch(_0x271a59){throw _0x179d85(_0x95c17f(0x113),null,_0x271a59,_0x95c17f(0x12e)),_0x271a59;}}async function Y(_0x15df0e,_0x50eadd){const _0x2b2e62=a0_0x42246c;return X({'fromAlias':_0x15df0e['fromAlias'],'toAlias':_0x15df0e['alias'],'parentTaskId':_0x15df0e[_0x2b2e62(0x104)]||null,'networkId':_0x15df0e[_0x2b2e62(0x122)]||null,'transport':_0x2b2e62(0x161),'lifecycleTracking':_0x2b2e62(0x127)},_0x50eadd);}class $ extends a0_0x614c1b{[a0_0x42246c(0x17c)];['alias'];[a0_0x42246c(0x105)];[a0_0x42246c(0x17e)];[a0_0x42246c(0x130)];[a0_0x42246c(0x150)];[a0_0x42246c(0x160)];[a0_0x42246c(0x110)];[a0_0x42246c(0x138)];['running']=!0x1;constructor(_0x4bfd48){const _0x5e6c33=a0_0x42246c;super();if(this[_0x5e6c33(0x17c)]=_0x4bfd48[_0x5e6c33(0x17c)][_0x5e6c33(0x147)](/\/$/,''),this[_0x5e6c33(0x14a)]=_0x4bfd48['alias'],this[_0x5e6c33(0x105)]=_0x4bfd48[_0x5e6c33(0x105)],this[_0x5e6c33(0x17e)]=_0x4bfd48[_0x5e6c33(0x17e)]||_0x5e6c33(0x144),this[_0x5e6c33(0x130)]=_0x5e6c33(0x13b)+_0x4bfd48[_0x5e6c33(0x14a)]+'-'+Date['now']()['toString'](0x24),this[_0x5e6c33(0x150)]=_0x4bfd48[_0x5e6c33(0x150)]??0x2bf20,this[_0x5e6c33(0x160)]=_0x4bfd48[_0x5e6c33(0x160)]??0xbb8,_0x4bfd48[_0x5e6c33(0x136)]!==!0x1)this['connect']();}[a0_0x42246c(0x143)](_0x7cf40){const _0x3af873=a0_0x42246c;console[_0x3af873(0x143)]('['+new Date()[_0x3af873(0x123)]()[_0x3af873(0x154)](0x0,0x8)+']\x20[commhub:'+this[_0x3af873(0x14a)]+']\x20'+_0x7cf40);}async[a0_0x42246c(0x10d)](_0x19380d,_0x49b43d){const _0x5f0ec=a0_0x42246c;let _0x1e1c62={'Content-Type':'application/json','Accept':_0x5f0ec(0xff)};if(this['token'])_0x1e1c62[_0x5f0ec(0x11b)]=_0x5f0ec(0x172)+this['token'];let _0x37ff52=await(await fetch(this[_0x5f0ec(0x17c)]+_0x5f0ec(0x125),{'method':_0x5f0ec(0x159),'headers':_0x1e1c62,'body':JSON[_0x5f0ec(0x10a)]({'jsonrpc':_0x5f0ec(0x11c),'id':Date['now'](),'method':_0x5f0ec(0x16f),'params':{'name':_0x19380d,'arguments':_0x49b43d}})}))[_0x5f0ec(0x17d)](),_0x572528=_0x37ff52[_0x5f0ec(0x176)](/data: (.+)/),_0x4449dd=_0x572528?JSON[_0x5f0ec(0x106)](_0x572528[0x1]):JSON[_0x5f0ec(0x106)](_0x37ff52),_0x291d00=_0x4449dd?.['result']?.[_0x5f0ec(0x174)]?.[0x0]?.[_0x5f0ec(0x17d)];return _0x291d00?JSON[_0x5f0ec(0x106)](_0x291d00):_0x4449dd;}async[a0_0x42246c(0x157)](){const _0x4ec024=a0_0x42246c;if(this[_0x4ec024(0x139)])return;this[_0x4ec024(0x139)]=!0x0,await this[_0x4ec024(0x133)](_0x4ec024(0x158)),this[_0x4ec024(0x143)](_0x4ec024(0x101)),this[_0x4ec024(0x110)]=setInterval(()=>{const _0x50984d=_0x4ec024;this['status']('idle')[_0x50984d(0x112)](_0x27572d=>this['log'](_0x50984d(0x128)+_0x27572d[_0x50984d(0x163)]));},this['heartbeatInterval']),this[_0x4ec024(0x131)]();}async[a0_0x42246c(0x17a)](){const _0x114d10=a0_0x42246c;if(this[_0x114d10(0x139)]=!0x1,this[_0x114d10(0x138)]?.[_0x114d10(0x137)](),this[_0x114d10(0x110)])clearInterval(this[_0x114d10(0x110)]);await this[_0x114d10(0x133)](_0x114d10(0x13a))['catch'](()=>{}),this[_0x114d10(0x143)]('disconnected');}async[a0_0x42246c(0x15e)](_0x95eedb,_0x5ba4c5,_0x57d2d5='normal'){const _0x59b618=a0_0x42246c;return Y({'alias':_0x95eedb,'fromAlias':this['alias']},{'log':_0x22adc4=>console[_0x59b618(0x143)](_0x22adc4),'send':()=>this[_0x59b618(0x10d)](_0x59b618(0x151),{'alias':_0x95eedb,'task':_0x5ba4c5,'priority':_0x57d2d5,'from_session':this[_0x59b618(0x14a)]})});}async['message'](_0x2de512,_0x3112f5){const _0x5d1c77=a0_0x42246c;return this[_0x5d1c77(0x10d)](_0x5d1c77(0x15b),{'alias':_0x2de512,'message':_0x3112f5,'from_session':this[_0x5d1c77(0x14a)]});}async[a0_0x42246c(0x15a)](_0x47bba5,_0x392158,_0x2bc3e6='completed'){const _0x2997a3=a0_0x42246c;return this['call'](_0x2997a3(0x16d),{'in_reply_to':_0x47bba5,'text':_0x392158,'status':_0x2bc3e6});}async['status'](_0x4dfba2,_0x2d3dac){const _0x3abf1c=a0_0x42246c;return this[_0x3abf1c(0x10d)](_0x3abf1c(0x17b),{'resume_id':this[_0x3abf1c(0x130)],'alias':this[_0x3abf1c(0x14a)],'status':_0x4dfba2,'server':a0_0x55d1c0(),'hostname':a0_0x55d1c0(),'agent':this['agent'],'project_dir':process[_0x3abf1c(0x152)](),..._0x2d3dac});}async[a0_0x42246c(0x100)](){return this['call']('get_all_status',{});}async[a0_0x42246c(0x134)](_0x370fa1,_0x102bb6){const _0x4483df=a0_0x42246c;return this['call']('broadcast',{'message':_0x370fa1,'filter_server':_0x102bb6?.[_0x4483df(0x10b)],'filter_status':_0x102bb6?.[_0x4483df(0x133)]});}async[a0_0x42246c(0x131)](){const _0x25b910=a0_0x42246c;let _0x233d00=encodeURIComponent(this[_0x25b910(0x14a)]),_0x441a52=this[_0x25b910(0x17c)]+_0x25b910(0x14f)+_0x233d00,_0x2d3993=this[_0x25b910(0x160)];while(this[_0x25b910(0x139)]){try{this[_0x25b910(0x138)]=new AbortController();let _0x29af1e={'Accept':_0x25b910(0x141)};if(this[_0x25b910(0x105)])_0x29af1e['Authorization']=_0x25b910(0x172)+this[_0x25b910(0x105)];let _0x10ff8f=await fetch(_0x441a52,{'headers':_0x29af1e,'signal':this[_0x25b910(0x138)][_0x25b910(0x14b)]});if(!_0x10ff8f['ok']||!_0x10ff8f[_0x25b910(0x175)]){this[_0x25b910(0x143)]('SSE\x20failed:\x20'+_0x10ff8f[_0x25b910(0x133)]),await this[_0x25b910(0x178)](_0x2d3993),_0x2d3993=Math['min'](_0x2d3993*1.5,0xea60);continue;}_0x2d3993=this[_0x25b910(0x160)];let _0x23938c=_0x10ff8f[_0x25b910(0x175)][_0x25b910(0x15f)](),_0xe7021=new TextDecoder(),_0x2eaf14='';while(this[_0x25b910(0x139)]){let {done:_0x26a94c,value:_0x57d59f}=await _0x23938c[_0x25b910(0x12f)]();if(_0x26a94c)break;_0x2eaf14+=_0xe7021[_0x25b910(0x109)](_0x57d59f,{'stream':!0x0});let _0x385708=_0x2eaf14['split']('\x0a');_0x2eaf14=_0x385708['pop']()||'';for(let _0x480325 of _0x385708){if(!_0x480325[_0x25b910(0x146)](_0x25b910(0x126)))continue;try{let _0x320d0a=JSON[_0x25b910(0x106)](_0x480325[_0x25b910(0x154)](0x6));if(_0x320d0a[_0x25b910(0x15c)]===_0x25b910(0x107)){this[_0x25b910(0x143)](_0x25b910(0x11e)),this[_0x25b910(0x17f)]('connected');continue;}if(_0x320d0a['type']==='new_task'||_0x320d0a[_0x25b910(0x15c)]==='new_message'||_0x320d0a[_0x25b910(0x15c)]==='broadcast')await this[_0x25b910(0x16b)]();}catch{}}}}catch(_0x444ea7){if(_0x444ea7[_0x25b910(0x179)]===_0x25b910(0x115))break;this[_0x25b910(0x17f)]('error',_0x444ea7),this['log']('SSE\x20error:\x20'+_0x444ea7[_0x25b910(0x163)]);}if(this['running'])this[_0x25b910(0x17f)](_0x25b910(0x16a)),this[_0x25b910(0x143)]('SSE\x20reconnecting\x20in\x20'+_0x2d3993/0x3e8+_0x25b910(0x173)),await this['sleep'](_0x2d3993),_0x2d3993=Math[_0x25b910(0x120)](_0x2d3993*1.5,0xea60);}}async[a0_0x42246c(0x16b)](){const _0x4db0f8=a0_0x42246c;try{let _0x306b97=(await this[_0x4db0f8(0x10d)](_0x4db0f8(0x129),{'alias':this[_0x4db0f8(0x14a)],'limit':0xa}))?.[_0x4db0f8(0x13f)]||[];for(let _0x23716d of _0x306b97)await this[_0x4db0f8(0x10d)](_0x4db0f8(0x10c),{'alias':this[_0x4db0f8(0x14a)],'message_id':_0x23716d['id']}),this[_0x4db0f8(0x143)]('←\x20'+_0x23716d[_0x4db0f8(0x167)]+':\x20'+_0x23716d['content'][_0x4db0f8(0x154)](0x0,0x3c)),this[_0x4db0f8(0x17f)]('task',_0x23716d),this[_0x4db0f8(0x17f)](_0x4db0f8(0x163),_0x23716d);}catch(_0x4eac54){this[_0x4db0f8(0x143)](_0x4db0f8(0x165)+_0x4eac54[_0x4db0f8(0x163)]);}}[a0_0x42246c(0x178)](_0x3f7839){return new Promise(_0x171cd2=>setTimeout(_0x171cd2,_0x3f7839));}}var F=$;export{F as default,$ as CommHub};
|
|
1
|
+
const a0_0x5b169f=a0_0x18a4;(function(_0x38d5a0,_0x57e691){const _0x4c9090=a0_0x18a4,_0x39e1c0=_0x38d5a0();while(!![]){try{const _0xf84c56=parseInt(_0x4c9090(0xaa))/0x1+parseInt(_0x4c9090(0xba))/0x2*(-parseInt(_0x4c9090(0x105))/0x3)+parseInt(_0x4c9090(0x102))/0x4+-parseInt(_0x4c9090(0xe1))/0x5+parseInt(_0x4c9090(0x8e))/0x6*(parseInt(_0x4c9090(0xfb))/0x7)+parseInt(_0x4c9090(0xf6))/0x8*(-parseInt(_0x4c9090(0xc3))/0x9)+parseInt(_0x4c9090(0xda))/0xa;if(_0xf84c56===_0x57e691)break;else _0x39e1c0['push'](_0x39e1c0['shift']());}catch(_0x43c405){_0x39e1c0['push'](_0x39e1c0['shift']());}}}(a0_0x1a4b,0x6632c));import{EventEmitter as a0_0x29bb58}from'events';import{hostname as a0_0x10445d}from'os';var K=/(?:atok|ntok|utok|ghp|github_pat)_[A-Za-z0-9_-]+|Bearer\s+\S+/gi,L=(_0x37f079,_0x35b676)=>(_0x37f079??_0x35b676)['replace'](/[\r\n\x00-\x1f\x7f]/g,'\x20')[a0_0x5b169f(0x9b)](0x0,0xf0);function N(_0x3bc5dc){const _0xd5b3bd=a0_0x5b169f;return(_0x3bc5dc instanceof Error?_0x3bc5dc[_0xd5b3bd(0xfe)]:String(_0x3bc5dc??'unknown\x20error'))[_0xd5b3bd(0x96)](K,_0xd5b3bd(0xa4))['replace'](/[\r\n\x00-\x1f\x7f]/g,'\x20')[_0xd5b3bd(0x9b)](0x0,0xf0);}function O(_0x4eb4bb,_0x1dafe2=process.env.ANET_TASK_TRACE_FORMAT==='json'){const _0x2e660b=a0_0x5b169f;if(_0x1dafe2)return JSON[_0x2e660b(0x101)](_0x4eb4bb);let _0x57b269=L(_0x4eb4bb[_0x2e660b(0xcd)],_0x2e660b(0xbe)),_0x4974e1=L(_0x4eb4bb[_0x2e660b(0xb7)],_0x2e660b(0x8c)),_0x29d9fb=_0x4eb4bb[_0x2e660b(0xf5)]?'\x20error='+_0x4eb4bb[_0x2e660b(0xf5)]+':'+(_0x4eb4bb[_0x2e660b(0xd2)]??''):'';return _0x2e660b(0xb8)+_0x4eb4bb[_0x2e660b(0x8b)]+_0x2e660b(0xce)+L(_0x4eb4bb[_0x2e660b(0xa8)],_0x2e660b(0xdf))+_0x2e660b(0x91)+L(_0x4eb4bb[_0x2e660b(0xc6)],_0x2e660b(0xdf))+'\x20task_id='+_0x4974e1+_0x2e660b(0xa7)+_0x57b269+_0x2e660b(0xa1)+L(_0x4eb4bb[_0x2e660b(0x94)],_0x2e660b(0xdf))+_0x2e660b(0xb6)+_0x4eb4bb[_0x2e660b(0xa0)]+_0x2e660b(0xf3)+_0x4eb4bb[_0x2e660b(0xc1)]+_0x2e660b(0xe6)+_0x4eb4bb[_0x2e660b(0xe3)]+_0x29d9fb;}function U(_0x52e2b7){const _0x3caa05=a0_0x5b169f;return{'event':{'sending':_0x3caa05(0xaf),'delivered':_0x3caa05(0xb9),'failed':_0x3caa05(0xbc),'acked':_0x3caa05(0x92),'started':'task.started','replied':'task.replied','expired':'task.expired'}[_0x52e2b7['status']],..._0x52e2b7};}function j(_0x456c53){const _0x1f0b12=a0_0x5b169f;let _0x115613=_0x456c53?.[_0x1f0b12(0xb7)]||_0x456c53?.[_0x1f0b12(0xc4)]||_0x456c53?.['id'];if(_0x115613)return String(_0x115613);let _0x555882=_0x456c53?.[_0x1f0b12(0xef)]?.[0x0]?.[_0x1f0b12(0x89)];if(typeof _0x555882!==_0x1f0b12(0xdd))return null;try{let _0x473e56=JSON['parse'](_0x555882);return _0x473e56?.['task_id']||_0x473e56?.[_0x1f0b12(0xc4)]||_0x473e56?.['id']||null;}catch{return null;}}async function X(_0x2978fb,_0x50c3dc){const _0x56cdcb=a0_0x5b169f;let _0x208940=_0x50c3dc[_0x56cdcb(0xe8)]??Date[_0x56cdcb(0xe8)],_0x1c4939=_0x208940(),_0x46caed=(_0x4896a2,_0x45b11a,_0x4a7bc9,_0x39d9af)=>{const _0x452cc6=_0x56cdcb;_0x50c3dc['log'](O(U({'from_alias':_0x2978fb['fromAlias'],'to_alias':_0x2978fb[_0x452cc6(0xb2)],'task_id':_0x45b11a,'parent_task_id':_0x2978fb['parentTaskId'],'network_id':_0x2978fb[_0x452cc6(0xf1)],'transport':_0x2978fb[_0x452cc6(0xa0)],'status':_0x4896a2,'duration_ms':_0x208940()-_0x1c4939,'lifecycle_tracking':_0x2978fb['lifecycleTracking'],..._0x4a7bc9!==void 0x0?{'error_code':_0x39d9af||_0x452cc6(0xfc),'error_message':N(_0x4a7bc9)}:{}})));};_0x46caed(_0x56cdcb(0x88),null);try{let _0x2d88b3=await _0x50c3dc[_0x56cdcb(0x9c)](),_0x89fd21=j(_0x2d88b3);if(_0x89fd21)_0x46caed(_0x56cdcb(0xad),_0x89fd21);else{if(_0x2d88b3?.['ok']===!0x1||_0x2d88b3?.[_0x56cdcb(0xec)])_0x46caed(_0x56cdcb(0x100),_0x89fd21,_0x2d88b3?.[_0x56cdcb(0xec)]||'CommHub\x20rejected\x20task',_0x56cdcb(0x98));else _0x46caed('failed',null,_0x56cdcb(0xd4),'missing_task_id');}return _0x2d88b3;}catch(_0x2fc96f){throw _0x46caed(_0x56cdcb(0x100),null,_0x2fc96f,_0x56cdcb(0xfc)),_0x2fc96f;}}function a0_0x18a4(_0x438cde,_0x58f630){_0x438cde=_0x438cde-0x88;const _0x1a4be1=a0_0x1a4b();let _0x18a438=_0x1a4be1[_0x438cde];return _0x18a438;}async function Y(_0x28e4f5,_0x66412e){const _0x2d6832=a0_0x5b169f;return X({'fromAlias':_0x28e4f5[_0x2d6832(0xff)],'toAlias':_0x28e4f5['alias'],'parentTaskId':_0x28e4f5[_0x2d6832(0xd6)]||null,'networkId':_0x28e4f5[_0x2d6832(0xf1)]||null,'transport':'mcp_http','lifecycleTracking':_0x2d6832(0xd7)},_0x66412e);}class $ extends a0_0x29bb58{[a0_0x5b169f(0xee)];[a0_0x5b169f(0xd0)];[a0_0x5b169f(0xf4)];['agent'];[a0_0x5b169f(0xfd)];['heartbeatInterval'];[a0_0x5b169f(0xab)];[a0_0x5b169f(0xa9)];['sseAbort'];[a0_0x5b169f(0xc7)]=!0x1;constructor(_0x2054cb){const _0x2405c1=a0_0x5b169f;super();if(this[_0x2405c1(0xee)]=_0x2054cb[_0x2405c1(0xee)][_0x2405c1(0x96)](/\/$/,''),this[_0x2405c1(0xd0)]=_0x2054cb[_0x2405c1(0xd0)],this[_0x2405c1(0xf4)]=_0x2054cb[_0x2405c1(0xf4)],this[_0x2405c1(0xd5)]=_0x2054cb['agent']||_0x2405c1(0xd9),this['resumeId']=_0x2405c1(0xc2)+_0x2054cb[_0x2405c1(0xd0)]+'-'+Date[_0x2405c1(0xe8)]()[_0x2405c1(0xeb)](0x24),this[_0x2405c1(0xb0)]=_0x2054cb['heartbeatInterval']??0x2bf20,this[_0x2405c1(0xab)]=_0x2054cb[_0x2405c1(0xab)]??0xbb8,_0x2054cb[_0x2405c1(0xea)]!==!0x1)this[_0x2405c1(0x99)]();}[a0_0x5b169f(0xf8)](_0x510084){const _0x1be377=a0_0x5b169f;console[_0x1be377(0xf8)]('['+new Date()[_0x1be377(0xa2)]()['slice'](0x0,0x8)+_0x1be377(0xca)+this[_0x1be377(0xd0)]+']\x20'+_0x510084);}async[a0_0x5b169f(0x9e)](_0x340b68,_0x48b5af){const _0x4d1f4e=a0_0x5b169f;let _0x1c3e8a={'Content-Type':'application/json','Accept':_0x4d1f4e(0xb5)};if(this['token'])_0x1c3e8a[_0x4d1f4e(0xe2)]=_0x4d1f4e(0xe4)+this[_0x4d1f4e(0xf4)];let _0x22e5c0=await(await fetch(this[_0x4d1f4e(0xee)]+_0x4d1f4e(0x9a),{'method':_0x4d1f4e(0xb3),'headers':_0x1c3e8a,'body':JSON[_0x4d1f4e(0x101)]({'jsonrpc':_0x4d1f4e(0x104),'id':Date[_0x4d1f4e(0xe8)](),'method':_0x4d1f4e(0xe0),'params':{'name':_0x340b68,'arguments':_0x48b5af}})}))[_0x4d1f4e(0x89)](),_0x360a80=_0x22e5c0[_0x4d1f4e(0xdb)](/data: (.+)/),_0x550b8b=_0x360a80?JSON[_0x4d1f4e(0x90)](_0x360a80[0x1]):JSON[_0x4d1f4e(0x90)](_0x22e5c0),_0x21a369=_0x550b8b?.['result']?.[_0x4d1f4e(0xef)]?.[0x0]?.[_0x4d1f4e(0x89)];return _0x21a369?JSON[_0x4d1f4e(0x90)](_0x21a369):_0x550b8b;}async[a0_0x5b169f(0x99)](){const _0x5a4b3a=a0_0x5b169f;if(this['running'])return;this[_0x5a4b3a(0xc7)]=!0x0,await this[_0x5a4b3a(0x8b)](_0x5a4b3a(0xd3)),this['log']('registered'),this[_0x5a4b3a(0xa9)]=setInterval(()=>{const _0x29e9fc=_0x5a4b3a;this['status']('idle')[_0x29e9fc(0x97)](_0x11b33f=>this[_0x29e9fc(0xf8)](_0x29e9fc(0xa6)+_0x11b33f[_0x29e9fc(0xfe)]));},this[_0x5a4b3a(0xb0)]),this['connectSSE']();}async[a0_0x5b169f(0x9f)](){const _0x39a6b1=a0_0x5b169f;if(this['running']=!0x1,this[_0x39a6b1(0xe7)]?.['abort'](),this[_0x39a6b1(0xa9)])clearInterval(this['heartbeatTimer']);await this[_0x39a6b1(0x8b)]('offline')[_0x39a6b1(0x97)](()=>{}),this[_0x39a6b1(0xf8)](_0x39a6b1(0xf7));}async[a0_0x5b169f(0x9c)](_0xf6817b,_0x984769,_0x5e9c3c=a0_0x5b169f(0xe5)){const _0x3f94c9=a0_0x5b169f;return Y({'alias':_0xf6817b,'fromAlias':this[_0x3f94c9(0xd0)]},{'log':_0x55430e=>console['log'](_0x55430e),'send':()=>this[_0x3f94c9(0x9e)]('send_task',{'alias':_0xf6817b,'task':_0x984769,'priority':_0x5e9c3c,'from_session':this[_0x3f94c9(0xd0)]})});}async[a0_0x5b169f(0xfe)](_0x321224,_0x3a7894){const _0x11f19a=a0_0x5b169f;return this[_0x11f19a(0x9e)](_0x11f19a(0xf0),{'alias':_0x321224,'message':_0x3a7894,'from_session':this[_0x11f19a(0xd0)]});}async[a0_0x5b169f(0xbf)](_0xac5c70,_0x73a354,_0x276e11='completed'){const _0x159ffc=a0_0x5b169f;return this['call'](_0x159ffc(0xb1),{'in_reply_to':_0xac5c70,'text':_0x73a354,'status':_0x276e11});}async[a0_0x5b169f(0x8b)](_0x2769f8,_0x577516){const _0x23ef42=a0_0x5b169f;return this[_0x23ef42(0x9e)](_0x23ef42(0xd8),{'resume_id':this[_0x23ef42(0xfd)],'alias':this['alias'],'status':_0x2769f8,'server':a0_0x10445d(),'hostname':a0_0x10445d(),'agent':this['agent'],'project_dir':process[_0x23ef42(0xa3)](),..._0x577516});}async[a0_0x5b169f(0xc5)](){const _0x35acae=a0_0x5b169f;return this[_0x35acae(0x9e)](_0x35acae(0xc8),{});}async[a0_0x5b169f(0xae)](_0x5d884a,_0x43d988){const _0xe73fef=a0_0x5b169f;return this[_0xe73fef(0x9e)](_0xe73fef(0xae),{'message':_0x5d884a,'filter_server':_0x43d988?.['server'],'filter_status':_0x43d988?.[_0xe73fef(0x8b)]});}async['connectSSE'](){const _0x52cee3=a0_0x5b169f;let _0x3d1def=encodeURIComponent(this[_0x52cee3(0xd0)]),_0x122bdd=this[_0x52cee3(0xee)]+_0x52cee3(0xa5)+_0x3d1def,_0x45f912=this[_0x52cee3(0xab)];while(this[_0x52cee3(0xc7)]){try{this['sseAbort']=new AbortController();let _0xe040b3={'Accept':_0x52cee3(0xbd)};if(this[_0x52cee3(0xf4)])_0xe040b3[_0x52cee3(0xe2)]=_0x52cee3(0xe4)+this[_0x52cee3(0xf4)];let _0x3960af=await fetch(_0x122bdd,{'headers':_0xe040b3,'signal':this[_0x52cee3(0xe7)]['signal']});if(!_0x3960af['ok']||!_0x3960af['body']){this[_0x52cee3(0xf8)]('SSE\x20failed:\x20'+_0x3960af[_0x52cee3(0x8b)]),await this[_0x52cee3(0xed)](_0x45f912),_0x45f912=Math[_0x52cee3(0xc0)](_0x45f912*1.5,0xea60);continue;}_0x45f912=this['reconnectDelay'];let _0x16f19e=_0x3960af['body'][_0x52cee3(0xdc)](),_0x108973=new TextDecoder(),_0x3ba176='';while(this['running']){let {done:_0x20b93d,value:_0x2fd472}=await _0x16f19e['read']();if(_0x20b93d)break;_0x3ba176+=_0x108973[_0x52cee3(0x9d)](_0x2fd472,{'stream':!0x0});let _0x55843d=_0x3ba176[_0x52cee3(0x8a)]('\x0a');_0x3ba176=_0x55843d[_0x52cee3(0xbb)]()||'';for(let _0xbf582e of _0x55843d){if(!_0xbf582e[_0x52cee3(0x95)](_0x52cee3(0x8f)))continue;try{let _0x440d83=JSON[_0x52cee3(0x90)](_0xbf582e[_0x52cee3(0x9b)](0x6));if(_0x440d83[_0x52cee3(0xe9)]===_0x52cee3(0xb4)){this[_0x52cee3(0xf8)](_0x52cee3(0xcf)),this[_0x52cee3(0x8d)]('connected');continue;}if(_0x440d83[_0x52cee3(0xe9)]===_0x52cee3(0xcc)||_0x440d83[_0x52cee3(0xe9)]==='new_message'||_0x440d83['type']===_0x52cee3(0xae))await this[_0x52cee3(0xac)]();}catch{}}}}catch(_0x2b009d){if(_0x2b009d[_0x52cee3(0xc9)]===_0x52cee3(0x106))break;this[_0x52cee3(0x8d)]('error',_0x2b009d),this[_0x52cee3(0xf8)](_0x52cee3(0x93)+_0x2b009d[_0x52cee3(0xfe)]);}if(this[_0x52cee3(0xc7)])this['emit']('disconnected'),this['log']('SSE\x20reconnecting\x20in\x20'+_0x45f912/0x3e8+_0x52cee3(0xfa)),await this[_0x52cee3(0xed)](_0x45f912),_0x45f912=Math['min'](_0x45f912*1.5,0xea60);}}async[a0_0x5b169f(0xac)](){const _0x5660c7=a0_0x5b169f;try{let _0x2e33de=(await this[_0x5660c7(0x9e)](_0x5660c7(0xde),{'alias':this[_0x5660c7(0xd0)],'limit':0xa}))?.[_0x5660c7(0xd1)]||[];for(let _0x3326e1 of _0x2e33de)await this['call'](_0x5660c7(0xf9),{'alias':this[_0x5660c7(0xd0)],'message_id':_0x3326e1['id']}),this[_0x5660c7(0xf8)]('←\x20'+_0x3326e1[_0x5660c7(0xcb)]+':\x20'+_0x3326e1['content']['slice'](0x0,0x3c)),this[_0x5660c7(0x8d)](_0x5660c7(0xf2),_0x3326e1),this['emit'](_0x5660c7(0xfe),_0x3326e1);}catch(_0x10b265){this['log'](_0x5660c7(0x103)+_0x10b265['message']);}}[a0_0x5b169f(0xed)](_0x5b4e63){return new Promise(_0x38298d=>setTimeout(_0x38298d,_0x5b4e63));}}function a0_0x1a4b(){const _0x5e8659=['status','<pending>','emit','42wsbyLn','data:\x20','parse','\x20to=','task.ack','SSE\x20error:\x20','network_id','startsWith','replace','catch','send_rejected','connect','/mcp','slice','send','decode','call','disconnect','transport','\x20network_id=','toTimeString','cwd','[REDACTED]','/events/','heartbeat\x20failed:\x20','\x20parent_task_id=','from_alias','heartbeatTimer','587181SXCGFV','reconnectDelay','processInbox','delivered','broadcast','task.send.start','heartbeatInterval','send_reply','toAlias','POST','connected','application/json,\x20text/event-stream','\x20transport=','task_id','[commhub:task]\x20','task.send.delivered','2NfYefw','pop','task.send.failed','text/event-stream','<missing>','reply','min','duration_ms','sdk-','99666gBUGKy','message_id','getAllStatus','to_alias','running','get_all_status','name',']\x20[commhub:','from_session','new_task','parent_task_id','\x20from=','SSE\x20connected','alias','messages','error_message','idle','CommHub\x20response\x20omitted\x20task_id','agent','parentTaskId','not_tracked','report_status','sdk','4983760UfMQhd','match','getReader','string','get_inbox','<unknown>','tools/call','3158700vayWHn','Authorization','lifecycle_tracking','Bearer\x20','normal','\x20lifecycle=','sseAbort','now','type','autoConnect','toString','error','sleep','url','content','send_message','networkId','task','\x20duration_ms=','token','error_code','272dWXPfW','disconnected','log','ack_inbox','s...','35021rGOpnU','send_failed','resumeId','message','fromAlias','failed','stringify','1240900lGpFBI','inbox\x20error:\x20','2.0','11829hEwVco','AbortError','sending','text','split'];a0_0x1a4b=function(){return _0x5e8659;};return a0_0x1a4b();}var F=$;export{F as default,$ as CommHub};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Merge user config.env into one co-presence stage. Required launcher values
|
|
2
|
+
* always win. Invalid shell names/NULs fail closed before a tmux session starts. */
|
|
3
|
+
export declare function codexCopresenceStageEnv(configEnv: Readonly<Record<string, string>>, required: Readonly<Record<string, string>>): Record<string, string>;
|
|
4
|
+
/** Contents for a private source-then-delete file. Values never enter argv. */
|
|
5
|
+
export declare function codexCopresenceEnvFileText(env: Readonly<Record<string, string>>): string;
|
|
@@ -4,6 +4,8 @@ export interface CodexRecoveryVerification {
|
|
|
4
4
|
verifiedAt: string;
|
|
5
5
|
historyTurnCount: number;
|
|
6
6
|
historyFingerprint: string;
|
|
7
|
+
/** Metadata-only thread/read proof that Codex resolved this exact rollout. */
|
|
8
|
+
persistedPath?: string;
|
|
7
9
|
}
|
|
8
10
|
export interface CodexRecoveryBackup {
|
|
9
11
|
backupDir: string;
|
|
@@ -13,6 +15,13 @@ export interface CodexRecoveryBackup {
|
|
|
13
15
|
/** Transaction boundary shared by Windows and POSIX cutovers: the snapshot
|
|
14
16
|
* cannot begin until every authoritative state writer has quiesced. */
|
|
15
17
|
export declare function quiesceThenSnapshot<T>(quiesce: () => Promise<void>, snapshot: () => T): Promise<T>;
|
|
18
|
+
/** Copy and hash without ever materializing the whole file in a Buffer.
|
|
19
|
+
* Zero chunks are sought over and the final length is truncated explicitly,
|
|
20
|
+
* so a multi-GiB sparse rollout stays sparse in the private recovery point. */
|
|
21
|
+
export declare function copyAndHashRecoveryFile(source: string, target: string): {
|
|
22
|
+
size: number;
|
|
23
|
+
sha256: string;
|
|
24
|
+
};
|
|
16
25
|
/** A stored thread is never considered resumed until app-server reads the
|
|
17
26
|
* exact thread back with persisted history. This is deliberately stricter
|
|
18
27
|
* than accepting a successful thread/resume RPC response. */
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare const CODEX_RESUME_TIMEOUT_ENV = "ANET_CODEX_RESUME_TIMEOUT_MS";
|
|
2
|
+
export declare const CODEX_RESUME_BASE_TIMEOUT_MS = 300000;
|
|
3
|
+
export declare const CODEX_RESUME_PER_GIB_MS = 120000;
|
|
4
|
+
export declare const CODEX_RESUME_MAX_TIMEOUT_MS: number;
|
|
5
|
+
export declare const CODEX_RECOVERY_MIN_PAYLOAD_BYTES: number;
|
|
6
|
+
export declare const CODEX_RECOVERY_PAYLOAD_OVERHEAD_BYTES: number;
|
|
7
|
+
export declare const CODEX_RECOVERY_MAX_PAYLOAD_BYTES: number;
|
|
8
|
+
export interface CopresenceResumeBudget {
|
|
9
|
+
timeoutMs: number;
|
|
10
|
+
rolloutBytes: number | null;
|
|
11
|
+
}
|
|
12
|
+
/** `--new-session` is authoritative for co-presence too: never feed the
|
|
13
|
+
* recorded thread into thread/resume when the operator explicitly asked for
|
|
14
|
+
* a fresh conversation. */
|
|
15
|
+
export declare function codexThreadIdForStart(recordedThreadId: string | undefined, newSession: boolean): string | undefined;
|
|
16
|
+
/** Resolve the recovery deadline once, before opening the app-server socket.
|
|
17
|
+
* The automatic budget is 300 s plus 120 s for each started GiB of the exact
|
|
18
|
+
* recorded rollout, capped at 15 minutes. An explicit environment value wins. */
|
|
19
|
+
export declare function resolveCopresenceResumeBudget(codexHome: string, threadId: string | undefined, env?: NodeJS.ProcessEnv, warn?: (message: string) => void): CopresenceResumeBudget;
|
|
20
|
+
export declare function resolveCopresenceResumeTimeoutMs(codexHome: string, threadId: string | undefined, env?: NodeJS.ProcessEnv, warn?: (message: string) => void): number;
|
|
21
|
+
export declare function formatCopresenceRolloutSize(bytes: number | null): string;
|
|
22
|
+
/** A finite receive ceiling for the one large thread/resume frame emitted by
|
|
23
|
+
* older Codex app-servers. Twice the rollout plus protocol headroom covers the
|
|
24
|
+
* measured JSON expansion without giving the loopback peer an unlimited heap. */
|
|
25
|
+
export declare function resolveCopresenceMaxPayloadBytes(rolloutBytes: number | null): number;
|
|
26
|
+
/** The bridge can make one retry after a resume timeout, so launcher readiness
|
|
27
|
+
* covers both bounded attempts instead of killing it at the old fixed 25 s. */
|
|
28
|
+
export declare function resolveCopresenceBridgeAttachTimeoutMs(resumeTimeoutMs: number): number;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type CodexRecoveryVerification } from "./codex-copresence-recovery";
|
|
2
|
+
export declare const SAFE_CODEX_THREAD_ID: RegExp;
|
|
3
|
+
/** Minimal JSON-RPC client used only while bringing up a co-presence app-server. */
|
|
4
|
+
export declare function createCodexCopresenceThread(ws: string, timeoutMs: number, resumeThreadId?: string, model?: string, options?: {
|
|
5
|
+
webSocketCtor?: any;
|
|
6
|
+
rolloutBytes?: number | null;
|
|
7
|
+
}): Promise<{
|
|
8
|
+
threadId: string;
|
|
9
|
+
verification?: CodexRecoveryVerification;
|
|
10
|
+
freshDeferred: boolean;
|
|
11
|
+
resumedModel?: string;
|
|
12
|
+
}>;
|
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
* not had a conversation yet (codex only writes a rollout on the first turn).
|
|
7
7
|
* It is bound to the identity marker of the generation that saw it, so a
|
|
8
8
|
* restart after a crash can carry it over to the next generation without
|
|
9
|
-
* guessing (`migrateCodexPendingThread`).
|
|
9
|
+
* guessing (`migrateCodexPendingThread`) once its exact rollout exists. A
|
|
10
|
+
* candidate acknowledged by RPC but never materialized remains pending and
|
|
11
|
+
* is dropped on the next start, even if the old marker file survived.
|
|
10
12
|
*
|
|
11
13
|
* A clean `anet node stop` reaps that generation and removes its marker, but
|
|
12
14
|
* the candidate stays in the config. Before #602 the next start then refused
|
|
@@ -47,6 +49,18 @@ export type PendingMarkerFact = {
|
|
|
47
49
|
/** Rollout files for exactly this thread id (suffix match, no prefix guessing), or `null` if the search itself failed. */
|
|
48
50
|
export type RolloutLookup = (threadId: string) => string[] | null;
|
|
49
51
|
export declare function decidePendingThreadAtStart(pending: unknown, marker: PendingMarkerFact, rollouts: RolloutLookup): PendingThreadAtStart;
|
|
52
|
+
/**
|
|
53
|
+
* Apply the decision to an in-memory node config without platform-specific
|
|
54
|
+
* shortcuts. Both launchers persist `config` before quiescing the old
|
|
55
|
+
* generation. Keeping the deletion here makes the Windows stop -> start
|
|
56
|
+
* behavior executable in the Linux Docker gate instead of relying only on a
|
|
57
|
+
* source-shape assertion (the native Windows smoke remains the end-to-end
|
|
58
|
+
* proof).
|
|
59
|
+
*/
|
|
60
|
+
export declare function reconcilePendingThreadAtStart<T extends Record<string, unknown>>(config: T, marker: PendingMarkerFact, rollouts: RolloutLookup): PendingThreadAtStart & {
|
|
61
|
+
config: T;
|
|
62
|
+
changed: boolean;
|
|
63
|
+
};
|
|
50
64
|
/**
|
|
51
65
|
* Every `*-<threadId>.jsonl` under `<codexHome>/sessions` and
|
|
52
66
|
* `<codexHome>/archived_sessions`. A missing directory is "no rollouts"; any
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { waitForStartResources, type StartGateDeps, type StartGateResult } from "./start-resource-gate";
|
|
2
|
+
/** A measured 500 MiB legacy recovery peaked at 8.4x its rollout size. Nine
|
|
3
|
+
* times the rollout leaves a small margin while remaining an explainable,
|
|
4
|
+
* testable admission estimate rather than pretending maxPayload bounds Codex. */
|
|
5
|
+
export declare const CODEX_RECOVERY_MEMORY_MULTIPLIER = 9;
|
|
6
|
+
export declare const CODEX_RECOVERY_MIN_MEMORY_MB = 4096;
|
|
7
|
+
export declare function estimatedCodexRecoveryMemoryMb(rolloutBytes: number | null): number;
|
|
8
|
+
export interface CodexRecoveryGateDeps extends StartGateDeps {
|
|
9
|
+
/** @internal seam: the shared start gate owns locking and stale-lease safety. */
|
|
10
|
+
gate?: typeof waitForStartResources;
|
|
11
|
+
}
|
|
12
|
+
/** Serialize the memory-heavy legacy resume phase and require enough effective
|
|
13
|
+
* MemAvailable for this rollout. The returned lease stays held through the
|
|
14
|
+
* launcher, bridge and TUI attachment and must then be released. */
|
|
15
|
+
export declare function waitForCodexRecoveryResources(nodeId: string, rolloutBytes: number | null, deps?: CodexRecoveryGateDeps): Promise<StartGateResult>;
|