@sleep2agi/agent-network 2.3.0-preview.162 → 2.3.0-preview.163

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.
@@ -1 +1 @@
1
- function a0_0x1fdd(_0x4e8c5d,_0x329a26){_0x4e8c5d=_0x4e8c5d-0x1ed;const _0x24762d=a0_0x2476();let _0x1fdd82=_0x24762d[_0x4e8c5d];return _0x1fdd82;}const a0_0x1ed6e1=a0_0x1fdd;(function(_0x5923c9,_0x4cf399){const _0x128037=a0_0x1fdd,_0x10bd66=_0x5923c9();while(!![]){try{const _0x40e898=-parseInt(_0x128037(0x210))/0x1+parseInt(_0x128037(0x22b))/0x2+-parseInt(_0x128037(0x266))/0x3+-parseInt(_0x128037(0x1fa))/0x4*(-parseInt(_0x128037(0x219))/0x5)+-parseInt(_0x128037(0x225))/0x6+parseInt(_0x128037(0x26b))/0x7*(-parseInt(_0x128037(0x221))/0x8)+parseInt(_0x128037(0x23b))/0x9;if(_0x40e898===_0x4cf399)break;else _0x10bd66['push'](_0x10bd66['shift']());}catch(_0x136b21){_0x10bd66['push'](_0x10bd66['shift']());}}}(a0_0x2476,0x482d9));import{EventEmitter as a0_0x5b76af}from'events';import{hostname as a0_0x245c96}from'os';var K=/(?:atok|ntok|utok|ghp|github_pat)_[A-Za-z0-9_-]+|Bearer\s+\S+/gi,L=(_0x59fd56,_0x100225)=>(_0x59fd56??_0x100225)['replace'](/[\r\n\x00-\x1f\x7f]/g,'\x20')['slice'](0x0,0xf0);function N(_0x886d72){const _0x5ce3f9=a0_0x1fdd;return(_0x886d72 instanceof Error?_0x886d72[_0x5ce3f9(0x259)]:String(_0x886d72??_0x5ce3f9(0x254)))['replace'](K,_0x5ce3f9(0x268))['replace'](/[\r\n\x00-\x1f\x7f]/g,'\x20')[_0x5ce3f9(0x23e)](0x0,0xf0);}function O(_0x3dbac0,_0x399967=process.env.ANET_TASK_TRACE_FORMAT===a0_0x1ed6e1(0x263)){const _0x5159c3=a0_0x1ed6e1;if(_0x399967)return JSON[_0x5159c3(0x21d)](_0x3dbac0);let _0x37575c=L(_0x3dbac0['parent_task_id'],_0x5159c3(0x243)),_0x2e5632=L(_0x3dbac0[_0x5159c3(0x24b)],'<pending>'),_0x55204d=_0x3dbac0[_0x5159c3(0x1fd)]?'\x20error='+_0x3dbac0['error_code']+':'+(_0x3dbac0[_0x5159c3(0x247)]??''):'';return _0x5159c3(0x24d)+_0x3dbac0[_0x5159c3(0x205)]+_0x5159c3(0x229)+L(_0x3dbac0[_0x5159c3(0x1fc)],_0x5159c3(0x216))+_0x5159c3(0x204)+L(_0x3dbac0[_0x5159c3(0x237)],_0x5159c3(0x216))+_0x5159c3(0x220)+_0x2e5632+_0x5159c3(0x23d)+_0x37575c+_0x5159c3(0x1f7)+L(_0x3dbac0[_0x5159c3(0x1ef)],_0x5159c3(0x216))+'\x20transport='+_0x3dbac0[_0x5159c3(0x242)]+_0x5159c3(0x236)+_0x3dbac0[_0x5159c3(0x241)]+_0x5159c3(0x1f3)+_0x3dbac0[_0x5159c3(0x1fe)]+_0x55204d;}function U(_0x5cd0d3){const _0x502992=a0_0x1ed6e1;return{'event':{'sending':_0x502992(0x25d),'delivered':_0x502992(0x227),'failed':_0x502992(0x1f1),'acked':_0x502992(0x22d),'started':_0x502992(0x26c),'replied':_0x502992(0x200),'expired':_0x502992(0x20b)}[_0x5cd0d3[_0x502992(0x205)]],..._0x5cd0d3};}function j(_0x78031f){const _0x57a560=a0_0x1ed6e1;let _0x3dff66=_0x78031f?.[_0x57a560(0x24b)]||_0x78031f?.[_0x57a560(0x264)]||_0x78031f?.['id'];if(_0x3dff66)return String(_0x3dff66);let _0x31c6d8=_0x78031f?.[_0x57a560(0x25b)]?.[0x0]?.['text'];if(typeof _0x31c6d8!=='string')return null;try{let _0x2062fc=JSON['parse'](_0x31c6d8);return _0x2062fc?.[_0x57a560(0x24b)]||_0x2062fc?.['message_id']||_0x2062fc?.['id']||null;}catch{return null;}}function a0_0x2476(){const _0x5bce8c=['\x20from=','CommHub\x20response\x20omitted\x20task_id','711284DkCCye','broadcast','task.ack','completed','offline','data:\x20','connected','sleep','new_message','text','toString','\x20duration_ms=','to_alias','get_all_status','connect','heartbeatTimer','7680429KMiEWO','from_session','\x20parent_task_id=','slice','call','AbortError','duration_ms','transport','<missing>','autoConnect','abort','lifecycleTracking','error_message','server','inbox\x20error:\x20','decode','task_id','toAlias','[commhub:task]\x20','application/json','SSE\x20reconnecting\x20in\x20','replace','type','heartbeatInterval','SSE\x20error:\x20','unknown\x20error','catch','signal','send_failed','match','message','min','content','idle','task.send.start','task','cwd','tools/call','CommHub\x20rejected\x20task','heartbeat\x20failed:\x20','json','message_id','alias','1074717DhrPzh','running','[REDACTED]','2.0','connectSSE','961268ZsvVYq','task.started','read','messages','log','body','emit','get_inbox','network_id','Authorization','task.send.failed','agent','\x20lifecycle=','reconnectDelay','url','registered','\x20network_id=','sdk','now','12qFRHiH','POST','from_alias','error_code','lifecycle_tracking','processInbox','task.replied','send_reply','fromAlias','parentTaskId','\x20to=','status','sdk-','sending','Bearer\x20','normal','error','task.expired','sseAbort','send','disconnect','resumeId','298704UxxlUx','send_message','s...','failed','ack_inbox','missing_task_id','<unknown>','split',']\x20[commhub:','20685PnRWin','token','getAllStatus','networkId','stringify','report_status','send_task','\x20task_id=','8kDBGUE','disconnected','getReader','parse','789156mYavUc','toTimeString','task.send.delivered','pop'];a0_0x2476=function(){return _0x5bce8c;};return a0_0x2476();}async function X(_0x44cbd7,_0x487004){const _0x4432a3=a0_0x1ed6e1;let _0x5eb6f5=_0x487004[_0x4432a3(0x1f9)]??Date[_0x4432a3(0x1f9)],_0xe13c27=_0x5eb6f5(),_0x48b829=(_0x5132ec,_0xaebd78,_0x4bd0a5,_0x17e4ed)=>{const _0xc90d73=_0x4432a3;_0x487004[_0xc90d73(0x26f)](O(U({'from_alias':_0x44cbd7[_0xc90d73(0x202)],'to_alias':_0x44cbd7[_0xc90d73(0x24c)],'task_id':_0xaebd78,'parent_task_id':_0x44cbd7[_0xc90d73(0x203)],'network_id':_0x44cbd7[_0xc90d73(0x21c)],'transport':_0x44cbd7[_0xc90d73(0x242)],'status':_0x5132ec,'duration_ms':_0x5eb6f5()-_0xe13c27,'lifecycle_tracking':_0x44cbd7[_0xc90d73(0x246)],..._0x4bd0a5!==void 0x0?{'error_code':_0x17e4ed||_0xc90d73(0x257),'error_message':N(_0x4bd0a5)}:{}})));};_0x48b829(_0x4432a3(0x207),null);try{let _0x462a99=await _0x487004[_0x4432a3(0x20d)](),_0x1b4038=j(_0x462a99);if(_0x1b4038)_0x48b829('delivered',_0x1b4038);else{if(_0x462a99?.['ok']===!0x1||_0x462a99?.[_0x4432a3(0x20a)])_0x48b829('failed',_0x1b4038,_0x462a99?.[_0x4432a3(0x20a)]||_0x4432a3(0x261),'send_rejected');else _0x48b829(_0x4432a3(0x213),null,_0x4432a3(0x22a),_0x4432a3(0x215));}return _0x462a99;}catch(_0x3d873b){throw _0x48b829('failed',null,_0x3d873b,_0x4432a3(0x257)),_0x3d873b;}}async function Y(_0x24a1bf,_0x4a6e05){const _0x388fca=a0_0x1ed6e1;return X({'fromAlias':_0x24a1bf[_0x388fca(0x202)],'toAlias':_0x24a1bf[_0x388fca(0x265)],'parentTaskId':_0x24a1bf[_0x388fca(0x203)]||null,'networkId':_0x24a1bf['networkId']||null,'transport':'mcp_http','lifecycleTracking':'not_tracked'},_0x4a6e05);}class $ extends a0_0x5b76af{[a0_0x1ed6e1(0x1f5)];[a0_0x1ed6e1(0x265)];['token'];[a0_0x1ed6e1(0x1f2)];[a0_0x1ed6e1(0x20f)];['heartbeatInterval'];[a0_0x1ed6e1(0x1f4)];[a0_0x1ed6e1(0x23a)];[a0_0x1ed6e1(0x20c)];[a0_0x1ed6e1(0x267)]=!0x1;constructor(_0x4897ed){const _0x952867=a0_0x1ed6e1;super();if(this['url']=_0x4897ed[_0x952867(0x1f5)][_0x952867(0x250)](/\/$/,''),this['alias']=_0x4897ed[_0x952867(0x265)],this[_0x952867(0x21a)]=_0x4897ed['token'],this[_0x952867(0x1f2)]=_0x4897ed['agent']||_0x952867(0x1f8),this[_0x952867(0x20f)]=_0x952867(0x206)+_0x4897ed[_0x952867(0x265)]+'-'+Date[_0x952867(0x1f9)]()[_0x952867(0x235)](0x24),this['heartbeatInterval']=_0x4897ed[_0x952867(0x252)]??0x2bf20,this[_0x952867(0x1f4)]=_0x4897ed[_0x952867(0x1f4)]??0xbb8,_0x4897ed[_0x952867(0x244)]!==!0x1)this['connect']();}[a0_0x1ed6e1(0x26f)](_0x410abe){const _0x38e3c6=a0_0x1ed6e1;console[_0x38e3c6(0x26f)]('['+new Date()[_0x38e3c6(0x226)]()[_0x38e3c6(0x23e)](0x0,0x8)+_0x38e3c6(0x218)+this['alias']+']\x20'+_0x410abe);}async[a0_0x1ed6e1(0x23f)](_0x326279,_0x38121d){const _0x25079a=a0_0x1ed6e1;let _0x4919ee={'Content-Type':_0x25079a(0x24e),'Accept':'application/json,\x20text/event-stream'};if(this[_0x25079a(0x21a)])_0x4919ee['Authorization']='Bearer\x20'+this[_0x25079a(0x21a)];let _0x33455c=await(await fetch(this['url']+'/mcp',{'method':_0x25079a(0x1fb),'headers':_0x4919ee,'body':JSON['stringify']({'jsonrpc':_0x25079a(0x269),'id':Date[_0x25079a(0x1f9)](),'method':_0x25079a(0x260),'params':{'name':_0x326279,'arguments':_0x38121d}})}))['text'](),_0x16f46c=_0x33455c[_0x25079a(0x258)](/data: (.+)/),_0x249da6=_0x16f46c?JSON[_0x25079a(0x224)](_0x16f46c[0x1]):JSON[_0x25079a(0x224)](_0x33455c),_0x3f26e5=_0x249da6?.['result']?.['content']?.[0x0]?.[_0x25079a(0x234)];return _0x3f26e5?JSON['parse'](_0x3f26e5):_0x249da6;}async[a0_0x1ed6e1(0x239)](){const _0x394c2f=a0_0x1ed6e1;if(this[_0x394c2f(0x267)])return;this[_0x394c2f(0x267)]=!0x0,await this[_0x394c2f(0x205)]('idle'),this[_0x394c2f(0x26f)](_0x394c2f(0x1f6)),this['heartbeatTimer']=setInterval(()=>{const _0x32f587=_0x394c2f;this[_0x32f587(0x205)](_0x32f587(0x25c))[_0x32f587(0x255)](_0x3c1804=>this[_0x32f587(0x26f)](_0x32f587(0x262)+_0x3c1804[_0x32f587(0x259)]));},this[_0x394c2f(0x252)]),this[_0x394c2f(0x26a)]();}async[a0_0x1ed6e1(0x20e)](){const _0x396c2d=a0_0x1ed6e1;if(this[_0x396c2d(0x267)]=!0x1,this['sseAbort']?.[_0x396c2d(0x245)](),this[_0x396c2d(0x23a)])clearInterval(this[_0x396c2d(0x23a)]);await this[_0x396c2d(0x205)](_0x396c2d(0x22f))['catch'](()=>{}),this[_0x396c2d(0x26f)]('disconnected');}async['send'](_0x4c7d46,_0x3b9a07,_0x479949=a0_0x1ed6e1(0x209)){const _0x5e173a=a0_0x1ed6e1;return Y({'alias':_0x4c7d46,'fromAlias':this[_0x5e173a(0x265)]},{'log':_0x414a92=>console[_0x5e173a(0x26f)](_0x414a92),'send':()=>this[_0x5e173a(0x23f)](_0x5e173a(0x21f),{'alias':_0x4c7d46,'task':_0x3b9a07,'priority':_0x479949,'from_session':this[_0x5e173a(0x265)]})});}async[a0_0x1ed6e1(0x259)](_0xe12d08,_0xc54351){const _0x21f94c=a0_0x1ed6e1;return this[_0x21f94c(0x23f)](_0x21f94c(0x211),{'alias':_0xe12d08,'message':_0xc54351,'from_session':this[_0x21f94c(0x265)]});}async['reply'](_0x114309,_0x21559e,_0x1d6fb2=a0_0x1ed6e1(0x22e)){const _0x184ae5=a0_0x1ed6e1;return this['call'](_0x184ae5(0x201),{'in_reply_to':_0x114309,'text':_0x21559e,'status':_0x1d6fb2});}async['status'](_0x3fc33a,_0x237582){const _0x26dbf1=a0_0x1ed6e1;return this[_0x26dbf1(0x23f)](_0x26dbf1(0x21e),{'resume_id':this[_0x26dbf1(0x20f)],'alias':this[_0x26dbf1(0x265)],'status':_0x3fc33a,'server':a0_0x245c96(),'hostname':a0_0x245c96(),'agent':this[_0x26dbf1(0x1f2)],'project_dir':process[_0x26dbf1(0x25f)](),..._0x237582});}async[a0_0x1ed6e1(0x21b)](){const _0x15a7bf=a0_0x1ed6e1;return this[_0x15a7bf(0x23f)](_0x15a7bf(0x238),{});}async[a0_0x1ed6e1(0x22c)](_0x255dc0,_0xa20cdc){const _0x4798b0=a0_0x1ed6e1;return this['call'](_0x4798b0(0x22c),{'message':_0x255dc0,'filter_server':_0xa20cdc?.[_0x4798b0(0x248)],'filter_status':_0xa20cdc?.['status']});}async['connectSSE'](){const _0x50e20b=a0_0x1ed6e1;let _0x23034e=encodeURIComponent(this[_0x50e20b(0x265)]),_0x39059e=this[_0x50e20b(0x1f5)]+'/events/'+_0x23034e,_0x258ebb=this['reconnectDelay'];while(this[_0x50e20b(0x267)]){try{this[_0x50e20b(0x20c)]=new AbortController();let _0x9ae965={'Accept':'text/event-stream'};if(this[_0x50e20b(0x21a)])_0x9ae965[_0x50e20b(0x1f0)]=_0x50e20b(0x208)+this['token'];let _0x549bf8=await fetch(_0x39059e,{'headers':_0x9ae965,'signal':this[_0x50e20b(0x20c)][_0x50e20b(0x256)]});if(!_0x549bf8['ok']||!_0x549bf8[_0x50e20b(0x270)]){this[_0x50e20b(0x26f)]('SSE\x20failed:\x20'+_0x549bf8[_0x50e20b(0x205)]),await this[_0x50e20b(0x232)](_0x258ebb),_0x258ebb=Math['min'](_0x258ebb*1.5,0xea60);continue;}_0x258ebb=this[_0x50e20b(0x1f4)];let _0x48c5ff=_0x549bf8['body'][_0x50e20b(0x223)](),_0x95fee2=new TextDecoder(),_0x168805='';while(this[_0x50e20b(0x267)]){let {done:_0x1bd773,value:_0x7b4e6e}=await _0x48c5ff[_0x50e20b(0x26d)]();if(_0x1bd773)break;_0x168805+=_0x95fee2[_0x50e20b(0x24a)](_0x7b4e6e,{'stream':!0x0});let _0x9e9274=_0x168805[_0x50e20b(0x217)]('\x0a');_0x168805=_0x9e9274[_0x50e20b(0x228)]()||'';for(let _0x21bda4 of _0x9e9274){if(!_0x21bda4['startsWith'](_0x50e20b(0x230)))continue;try{let _0x254fd4=JSON[_0x50e20b(0x224)](_0x21bda4['slice'](0x6));if(_0x254fd4['type']===_0x50e20b(0x231)){this[_0x50e20b(0x26f)]('SSE\x20connected'),this[_0x50e20b(0x1ed)]('connected');continue;}if(_0x254fd4[_0x50e20b(0x251)]==='new_task'||_0x254fd4[_0x50e20b(0x251)]===_0x50e20b(0x233)||_0x254fd4[_0x50e20b(0x251)]===_0x50e20b(0x22c))await this[_0x50e20b(0x1ff)]();}catch{}}}}catch(_0x496833){if(_0x496833['name']===_0x50e20b(0x240))break;this[_0x50e20b(0x1ed)]('error',_0x496833),this[_0x50e20b(0x26f)](_0x50e20b(0x253)+_0x496833['message']);}if(this[_0x50e20b(0x267)])this[_0x50e20b(0x1ed)](_0x50e20b(0x222)),this[_0x50e20b(0x26f)](_0x50e20b(0x24f)+_0x258ebb/0x3e8+_0x50e20b(0x212)),await this[_0x50e20b(0x232)](_0x258ebb),_0x258ebb=Math[_0x50e20b(0x25a)](_0x258ebb*1.5,0xea60);}}async[a0_0x1ed6e1(0x1ff)](){const _0x2a4e3e=a0_0x1ed6e1;try{let _0x323ffe=(await this['call'](_0x2a4e3e(0x1ee),{'alias':this[_0x2a4e3e(0x265)],'limit':0xa}))?.[_0x2a4e3e(0x26e)]||[];for(let _0x3465ee of _0x323ffe)await this['call'](_0x2a4e3e(0x214),{'alias':this['alias'],'message_id':_0x3465ee['id']}),this[_0x2a4e3e(0x26f)]('←\x20'+_0x3465ee[_0x2a4e3e(0x23c)]+':\x20'+_0x3465ee[_0x2a4e3e(0x25b)][_0x2a4e3e(0x23e)](0x0,0x3c)),this[_0x2a4e3e(0x1ed)](_0x2a4e3e(0x25e),_0x3465ee),this[_0x2a4e3e(0x1ed)]('message',_0x3465ee);}catch(_0x6c91dc){this[_0x2a4e3e(0x26f)](_0x2a4e3e(0x249)+_0x6c91dc['message']);}}[a0_0x1ed6e1(0x232)](_0x5c55e7){return new Promise(_0x3fcf97=>setTimeout(_0x3fcf97,_0x5c55e7));}}var F=$;export{F as default,$ as CommHub};
1
+ const a0_0x4ea5e8=a0_0x10fd;(function(_0xca7b96,_0xd533d0){const _0x156c39=a0_0x10fd,_0x5e3948=_0xca7b96();while(!![]){try{const _0x3f3e07=-parseInt(_0x156c39(0x186))/0x1+-parseInt(_0x156c39(0x172))/0x2+-parseInt(_0x156c39(0x10e))/0x3*(parseInt(_0x156c39(0x15d))/0x4)+-parseInt(_0x156c39(0x120))/0x5+-parseInt(_0x156c39(0x135))/0x6+-parseInt(_0x156c39(0x141))/0x7*(parseInt(_0x156c39(0x17a))/0x8)+-parseInt(_0x156c39(0x106))/0x9*(-parseInt(_0x156c39(0x159))/0xa);if(_0x3f3e07===_0xd533d0)break;else _0x5e3948['push'](_0x5e3948['shift']());}catch(_0x19f051){_0x5e3948['push'](_0x5e3948['shift']());}}}(a0_0x4acd,0xc4061));import{EventEmitter as a0_0x3f2ca8}from'events';import{hostname as a0_0x37101a}from'os';var K=/(?:atok|ntok|utok|ghp|github_pat)_[A-Za-z0-9_-]+|Bearer\s+\S+/gi,L=(_0x778806,_0x2dce13)=>(_0x778806??_0x2dce13)[a0_0x4ea5e8(0x147)](/[\r\n\x00-\x1f\x7f]/g,'\x20')[a0_0x4ea5e8(0x10f)](0x0,0xf0);function a0_0x10fd(_0x10449d,_0x58eb82){_0x10449d=_0x10449d-0x106;const _0x4acd85=a0_0x4acd();let _0x10fd74=_0x4acd85[_0x10449d];return _0x10fd74;}function N(_0x2c9522){const _0x4dc4d9=a0_0x4ea5e8;return(_0x2c9522 instanceof Error?_0x2c9522['message']:String(_0x2c9522??_0x4dc4d9(0x166)))[_0x4dc4d9(0x147)](K,_0x4dc4d9(0x140))[_0x4dc4d9(0x147)](/[\r\n\x00-\x1f\x7f]/g,'\x20')[_0x4dc4d9(0x10f)](0x0,0xf0);}function O(_0x4d2138,_0x5082d6=process.env.ANET_TASK_TRACE_FORMAT===a0_0x4ea5e8(0x16d)){const _0x374e50=a0_0x4ea5e8;if(_0x5082d6)return JSON[_0x374e50(0x183)](_0x4d2138);let _0x480f93=L(_0x4d2138[_0x374e50(0x16e)],_0x374e50(0x17d)),_0x3b0083=L(_0x4d2138[_0x374e50(0x109)],_0x374e50(0x12a)),_0x5b4aa3=_0x4d2138[_0x374e50(0x17b)]?_0x374e50(0x173)+_0x4d2138[_0x374e50(0x17b)]+':'+(_0x4d2138[_0x374e50(0x10b)]??''):'';return _0x374e50(0x180)+_0x4d2138[_0x374e50(0x149)]+_0x374e50(0x11f)+L(_0x4d2138['from_alias'],_0x374e50(0x13a))+_0x374e50(0x122)+L(_0x4d2138['to_alias'],_0x374e50(0x13a))+'\x20task_id='+_0x3b0083+_0x374e50(0x12f)+_0x480f93+_0x374e50(0x188)+L(_0x4d2138['network_id'],_0x374e50(0x13a))+_0x374e50(0x108)+_0x4d2138['transport']+_0x374e50(0x148)+_0x4d2138[_0x374e50(0x13d)]+_0x374e50(0x14d)+_0x4d2138[_0x374e50(0x162)]+_0x5b4aa3;}function U(_0x5efb49){const _0x4b490d=a0_0x4ea5e8;return{'event':{'sending':_0x4b490d(0x11a),'delivered':_0x4b490d(0x10d),'failed':_0x4b490d(0x119),'acked':'task.ack','started':_0x4b490d(0x144),'replied':_0x4b490d(0x161),'expired':_0x4b490d(0x116)}[_0x5efb49['status']],..._0x5efb49};}function j(_0x5407d1){const _0x2f4a27=a0_0x4ea5e8;let _0x1cbf77=_0x5407d1?.[_0x2f4a27(0x109)]||_0x5407d1?.[_0x2f4a27(0x155)]||_0x5407d1?.['id'];if(_0x1cbf77)return String(_0x1cbf77);let _0x393e6f=_0x5407d1?.['content']?.[0x0]?.[_0x2f4a27(0x15b)];if(typeof _0x393e6f!=='string')return null;try{let _0x5237f2=JSON[_0x2f4a27(0x13b)](_0x393e6f);return _0x5237f2?.[_0x2f4a27(0x109)]||_0x5237f2?.[_0x2f4a27(0x155)]||_0x5237f2?.['id']||null;}catch{return null;}}async function X(_0x90e488,_0x259b22){const _0x538e5e=a0_0x4ea5e8;let _0x28ed6e=_0x259b22['now']??Date['now'],_0x1d03d6=_0x28ed6e(),_0x1ca68a=(_0x155091,_0x2a8d50,_0x1202bf,_0x75ed1c)=>{const _0x338135=a0_0x10fd;_0x259b22[_0x338135(0x179)](O(U({'from_alias':_0x90e488[_0x338135(0x129)],'to_alias':_0x90e488[_0x338135(0x174)],'task_id':_0x2a8d50,'parent_task_id':_0x90e488['parentTaskId'],'network_id':_0x90e488['networkId'],'transport':_0x90e488['transport'],'status':_0x155091,'duration_ms':_0x28ed6e()-_0x1d03d6,'lifecycle_tracking':_0x90e488[_0x338135(0x145)],..._0x1202bf!==void 0x0?{'error_code':_0x75ed1c||_0x338135(0x163),'error_message':N(_0x1202bf)}:{}})));};_0x1ca68a(_0x538e5e(0x17e),null);try{let _0xbb97ff=await _0x259b22[_0x538e5e(0x112)](),_0x49bf7a=j(_0xbb97ff);if(_0x49bf7a)_0x1ca68a(_0x538e5e(0x171),_0x49bf7a);else{if(_0xbb97ff?.['ok']===!0x1||_0xbb97ff?.['error'])_0x1ca68a(_0x538e5e(0x17c),_0x49bf7a,_0xbb97ff?.[_0x538e5e(0x15a)]||_0x538e5e(0x11d),_0x538e5e(0x12d));else _0x1ca68a(_0x538e5e(0x17c),null,'CommHub\x20response\x20omitted\x20task_id','missing_task_id');}return _0xbb97ff;}catch(_0x53b4c1){throw _0x1ca68a('failed',null,_0x53b4c1,_0x538e5e(0x163)),_0x53b4c1;}}async function Y(_0x10a92d,_0xa9b59f){const _0xc52706=a0_0x4ea5e8;return X({'fromAlias':_0x10a92d[_0xc52706(0x129)],'toAlias':_0x10a92d['alias'],'parentTaskId':_0x10a92d[_0xc52706(0x13e)]||null,'networkId':_0x10a92d[_0xc52706(0x157)]||null,'transport':_0xc52706(0x14c),'lifecycleTracking':_0xc52706(0x16f)},_0xa9b59f);}function a0_0x4acd(){const _0x429074=['getAllStatus','toTimeString','s...','sleep','1178400PWRcGI','server','idle','toString','signal','<unknown>','parse','token','duration_ms','parentTaskId','name','[REDACTED]','146615DDHNzC','abort','url','task.started','lifecycleTracking','message','replace','\x20duration_ms=','status','Authorization','sdk','mcp_http','\x20lifecycle=','text/event-stream','send_reply','reconnectDelay','inbox\x20error:\x20','processInbox','disconnected','broadcast','message_id','SSE\x20connected','networkId','split','3256460hVZDYO','error','text','read','12abkKhf','sdk-','tools/call','content','task.replied','lifecycle_tracking','send_failed','2.0','/events/','unknown\x20error','sseAbort','connectSSE','AbortError','POST','application/json,\x20text/event-stream','SSE\x20reconnecting\x20in\x20','json','parent_task_id','not_tracked','pop','delivered','930836BrfCIZ','\x20error=','toAlias','alias','report_status','Bearer\x20','body','log','136otRAOC','error_code','failed','<missing>','sending','cwd','[commhub:task]\x20','decode','call','stringify','SSE\x20error:\x20','reply','1118154XLHBcm',']\x20[commhub:','\x20network_id=','running','126uAXuKU','messages','\x20transport=','task_id','result','error_message','catch','task.send.delivered','514011XfCbZm','slice','application/json','/mcp','send','task','getReader','SSE\x20failed:\x20','task.expired','heartbeatInterval','connected','task.send.failed','task.send.start','heartbeatTimer','completed','CommHub\x20rejected\x20task','type','\x20from=','5530415fnvTAG','data:\x20','\x20to=','emit','agent','ack_inbox','registered','connect','resumeId','fromAlias','<pending>','now','min','send_rejected','get_inbox','\x20parent_task_id=','match'];a0_0x4acd=function(){return _0x429074;};return a0_0x4acd();}class $ extends a0_0x3f2ca8{[a0_0x4ea5e8(0x143)];[a0_0x4ea5e8(0x175)];[a0_0x4ea5e8(0x13c)];[a0_0x4ea5e8(0x124)];['resumeId'];['heartbeatInterval'];[a0_0x4ea5e8(0x150)];['heartbeatTimer'];[a0_0x4ea5e8(0x167)];[a0_0x4ea5e8(0x189)]=!0x1;constructor(_0x251fdc){const _0x52d4f5=a0_0x4ea5e8;super();if(this['url']=_0x251fdc[_0x52d4f5(0x143)]['replace'](/\/$/,''),this['alias']=_0x251fdc[_0x52d4f5(0x175)],this[_0x52d4f5(0x13c)]=_0x251fdc[_0x52d4f5(0x13c)],this[_0x52d4f5(0x124)]=_0x251fdc[_0x52d4f5(0x124)]||_0x52d4f5(0x14b),this[_0x52d4f5(0x128)]=_0x52d4f5(0x15e)+_0x251fdc[_0x52d4f5(0x175)]+'-'+Date[_0x52d4f5(0x12b)]()[_0x52d4f5(0x138)](0x24),this[_0x52d4f5(0x117)]=_0x251fdc[_0x52d4f5(0x117)]??0x2bf20,this['reconnectDelay']=_0x251fdc[_0x52d4f5(0x150)]??0xbb8,_0x251fdc['autoConnect']!==!0x1)this[_0x52d4f5(0x127)]();}['log'](_0x55072b){const _0x251d51=a0_0x4ea5e8;console['log']('['+new Date()[_0x251d51(0x132)]()[_0x251d51(0x10f)](0x0,0x8)+_0x251d51(0x187)+this[_0x251d51(0x175)]+']\x20'+_0x55072b);}async[a0_0x4ea5e8(0x182)](_0x36da4e,_0x3d3062){const _0x3c4a57=a0_0x4ea5e8;let _0xf6a61d={'Content-Type':_0x3c4a57(0x110),'Accept':_0x3c4a57(0x16b)};if(this['token'])_0xf6a61d[_0x3c4a57(0x14a)]='Bearer\x20'+this[_0x3c4a57(0x13c)];let _0x5a2082=await(await fetch(this[_0x3c4a57(0x143)]+_0x3c4a57(0x111),{'method':_0x3c4a57(0x16a),'headers':_0xf6a61d,'body':JSON[_0x3c4a57(0x183)]({'jsonrpc':_0x3c4a57(0x164),'id':Date[_0x3c4a57(0x12b)](),'method':_0x3c4a57(0x15f),'params':{'name':_0x36da4e,'arguments':_0x3d3062}})}))[_0x3c4a57(0x15b)](),_0x514dc9=_0x5a2082[_0x3c4a57(0x130)](/data: (.+)/),_0x33e4c4=_0x514dc9?JSON[_0x3c4a57(0x13b)](_0x514dc9[0x1]):JSON[_0x3c4a57(0x13b)](_0x5a2082),_0x4a2c01=_0x33e4c4?.[_0x3c4a57(0x10a)]?.[_0x3c4a57(0x160)]?.[0x0]?.[_0x3c4a57(0x15b)];return _0x4a2c01?JSON[_0x3c4a57(0x13b)](_0x4a2c01):_0x33e4c4;}async[a0_0x4ea5e8(0x127)](){const _0xee57e3=a0_0x4ea5e8;if(this[_0xee57e3(0x189)])return;this['running']=!0x0,await this['status']('idle'),this[_0xee57e3(0x179)](_0xee57e3(0x126)),this[_0xee57e3(0x11b)]=setInterval(()=>{const _0x4f2859=_0xee57e3;this[_0x4f2859(0x149)](_0x4f2859(0x137))[_0x4f2859(0x10c)](_0x4bc727=>this[_0x4f2859(0x179)]('heartbeat\x20failed:\x20'+_0x4bc727['message']));},this[_0xee57e3(0x117)]),this[_0xee57e3(0x168)]();}async['disconnect'](){const _0x39dfad=a0_0x4ea5e8;if(this[_0x39dfad(0x189)]=!0x1,this['sseAbort']?.[_0x39dfad(0x142)](),this['heartbeatTimer'])clearInterval(this[_0x39dfad(0x11b)]);await this['status']('offline')[_0x39dfad(0x10c)](()=>{}),this['log'](_0x39dfad(0x153));}async[a0_0x4ea5e8(0x112)](_0xca7721,_0x3450aa,_0x415f2a='normal'){const _0x456798=a0_0x4ea5e8;return Y({'alias':_0xca7721,'fromAlias':this[_0x456798(0x175)]},{'log':_0x359816=>console[_0x456798(0x179)](_0x359816),'send':()=>this[_0x456798(0x182)]('send_task',{'alias':_0xca7721,'task':_0x3450aa,'priority':_0x415f2a,'from_session':this['alias']})});}async[a0_0x4ea5e8(0x146)](_0x1e2941,_0x4412f3){const _0x2b4134=a0_0x4ea5e8;return this[_0x2b4134(0x182)]('send_message',{'alias':_0x1e2941,'message':_0x4412f3,'from_session':this[_0x2b4134(0x175)]});}async[a0_0x4ea5e8(0x185)](_0x8f8d6b,_0x42af85,_0x338d96=a0_0x4ea5e8(0x11c)){const _0x5357fa=a0_0x4ea5e8;return this[_0x5357fa(0x182)](_0x5357fa(0x14f),{'in_reply_to':_0x8f8d6b,'text':_0x42af85,'status':_0x338d96});}async['status'](_0x300086,_0x1cb685){const _0x55f6f5=a0_0x4ea5e8;return this[_0x55f6f5(0x182)](_0x55f6f5(0x176),{'resume_id':this[_0x55f6f5(0x128)],'alias':this[_0x55f6f5(0x175)],'status':_0x300086,'server':a0_0x37101a(),'hostname':a0_0x37101a(),'agent':this[_0x55f6f5(0x124)],'project_dir':process[_0x55f6f5(0x17f)](),..._0x1cb685});}async[a0_0x4ea5e8(0x131)](){return this['call']('get_all_status',{});}async[a0_0x4ea5e8(0x154)](_0x10162f,_0x66ffdb){const _0x4997e3=a0_0x4ea5e8;return this[_0x4997e3(0x182)](_0x4997e3(0x154),{'message':_0x10162f,'filter_server':_0x66ffdb?.[_0x4997e3(0x136)],'filter_status':_0x66ffdb?.[_0x4997e3(0x149)]});}async['connectSSE'](){const _0x305ef1=a0_0x4ea5e8;let _0x2c2dd7=encodeURIComponent(this[_0x305ef1(0x175)]),_0x2e0c5e=this[_0x305ef1(0x143)]+_0x305ef1(0x165)+_0x2c2dd7,_0x5066f4=this[_0x305ef1(0x150)];while(this[_0x305ef1(0x189)]){try{this[_0x305ef1(0x167)]=new AbortController();let _0x2a1f92={'Accept':_0x305ef1(0x14e)};if(this[_0x305ef1(0x13c)])_0x2a1f92[_0x305ef1(0x14a)]=_0x305ef1(0x177)+this['token'];let _0x2771fc=await fetch(_0x2e0c5e,{'headers':_0x2a1f92,'signal':this[_0x305ef1(0x167)][_0x305ef1(0x139)]});if(!_0x2771fc['ok']||!_0x2771fc[_0x305ef1(0x178)]){this['log'](_0x305ef1(0x115)+_0x2771fc['status']),await this['sleep'](_0x5066f4),_0x5066f4=Math['min'](_0x5066f4*1.5,0xea60);continue;}_0x5066f4=this['reconnectDelay'];let _0x3837c0=_0x2771fc[_0x305ef1(0x178)][_0x305ef1(0x114)](),_0x3774e5=new TextDecoder(),_0xb91975='';while(this[_0x305ef1(0x189)]){let {done:_0x58b9ed,value:_0x44598f}=await _0x3837c0[_0x305ef1(0x15c)]();if(_0x58b9ed)break;_0xb91975+=_0x3774e5[_0x305ef1(0x181)](_0x44598f,{'stream':!0x0});let _0x1b84c0=_0xb91975[_0x305ef1(0x158)]('\x0a');_0xb91975=_0x1b84c0[_0x305ef1(0x170)]()||'';for(let _0x5e44b4 of _0x1b84c0){if(!_0x5e44b4['startsWith'](_0x305ef1(0x121)))continue;try{let _0x10820a=JSON['parse'](_0x5e44b4[_0x305ef1(0x10f)](0x6));if(_0x10820a[_0x305ef1(0x11e)]===_0x305ef1(0x118)){this[_0x305ef1(0x179)](_0x305ef1(0x156)),this[_0x305ef1(0x123)](_0x305ef1(0x118));continue;}if(_0x10820a[_0x305ef1(0x11e)]==='new_task'||_0x10820a[_0x305ef1(0x11e)]==='new_message'||_0x10820a[_0x305ef1(0x11e)]==='broadcast')await this[_0x305ef1(0x152)]();}catch{}}}}catch(_0x3b3c83){if(_0x3b3c83[_0x305ef1(0x13f)]===_0x305ef1(0x169))break;this[_0x305ef1(0x123)](_0x305ef1(0x15a),_0x3b3c83),this[_0x305ef1(0x179)](_0x305ef1(0x184)+_0x3b3c83['message']);}if(this['running'])this['emit'](_0x305ef1(0x153)),this[_0x305ef1(0x179)](_0x305ef1(0x16c)+_0x5066f4/0x3e8+_0x305ef1(0x133)),await this[_0x305ef1(0x134)](_0x5066f4),_0x5066f4=Math[_0x305ef1(0x12c)](_0x5066f4*1.5,0xea60);}}async[a0_0x4ea5e8(0x152)](){const _0x24aafd=a0_0x4ea5e8;try{let _0x1ef60c=(await this[_0x24aafd(0x182)](_0x24aafd(0x12e),{'alias':this[_0x24aafd(0x175)],'limit':0xa}))?.[_0x24aafd(0x107)]||[];for(let _0x165b08 of _0x1ef60c)await this[_0x24aafd(0x182)](_0x24aafd(0x125),{'alias':this[_0x24aafd(0x175)],'message_id':_0x165b08['id']}),this[_0x24aafd(0x179)]('←\x20'+_0x165b08['from_session']+':\x20'+_0x165b08[_0x24aafd(0x160)][_0x24aafd(0x10f)](0x0,0x3c)),this[_0x24aafd(0x123)](_0x24aafd(0x113),_0x165b08),this['emit'](_0x24aafd(0x146),_0x165b08);}catch(_0x5c27ab){this[_0x24aafd(0x179)](_0x24aafd(0x151)+_0x5c27ab[_0x24aafd(0x146)]);}}[a0_0x4ea5e8(0x134)](_0x18d099){return new Promise(_0x202a9e=>setTimeout(_0x202a9e,_0x18d099));}}var F=$;export{F as default,$ as CommHub};
@@ -4,6 +4,8 @@ export interface CodexHomeLoginVerdict {
4
4
  /** One phrase for the operator: why this state. No secrets. */
5
5
  readonly reason: string;
6
6
  }
7
+ /** Selected custom provider only. A field name is returned, never a key value. */
8
+ export declare function codexProviderEnvKey(configToml: string): string | null;
7
9
  /** The node's verdict. auth.json is judged by the #529 helper; see the header for the two fail-open cases. */
8
10
  export declare function codexHomeLoginState(codexHome: string, env?: Record<string, string | undefined>): CodexHomeLoginVerdict;
9
11
  /** Exit code for `needs-login`: distinct from 1 (failed) so scripts can tell "do something" from "broken". */
@@ -112,6 +112,7 @@ export declare function shouldPersistCodexFullAccess(dangerFlagPassed: boolean,
112
112
  */
113
113
  export declare function codexCopresenceCreateFields(normalizedRuntime: string | undefined, copresenceOpt: string | boolean | undefined): {
114
114
  codexCopresence?: true;
115
+ codexCopresenceFullAccess?: true;
115
116
  };
116
117
  /**
117
118
  * One line at create time for a node that will start headless.
@@ -6,6 +6,9 @@ export interface CodexRecoveryVerification {
6
6
  historyFingerprint: string;
7
7
  /** Metadata-only thread/read proof that Codex resolved this exact rollout. */
8
8
  persistedPath?: string;
9
+ /** Present only when an explicitly selected Provider was read back from the runtime. */
10
+ modelProvider?: string;
11
+ model?: string;
9
12
  }
10
13
  export interface CodexRecoveryBackup {
11
14
  backupDir: string;
@@ -39,7 +42,7 @@ export declare function verifyCodexThreadHistory(method: "thread/start" | "threa
39
42
  * Returns the model the app-server reports for the resumed thread (if any) so
40
43
  * the caller can say which model the session is actually on.
41
44
  */
42
- export declare function resumeAndVerifyCodexThread(threadId: string, request: (method: string, params: Record<string, unknown>) => Promise<unknown>, model?: string): Promise<CodexRecoveryVerification & {
45
+ export declare function resumeAndVerifyCodexThread(threadId: string, request: (method: string, params: Record<string, unknown>) => Promise<unknown>, model?: string, modelProvider?: string): Promise<CodexRecoveryVerification & {
43
46
  resumedModel?: string;
44
47
  }>;
45
48
  /** Private, node-local recovery point. config-recovery.json is deliberately
@@ -7,6 +7,7 @@ options?: {
7
7
  webSocketCtor?: any;
8
8
  rolloutBytes?: number | null;
9
9
  forkFirst?: boolean;
10
+ modelProvider?: string;
10
11
  }): Promise<{
11
12
  threadId: string;
12
13
  verification?: CodexRecoveryVerification;
@@ -0,0 +1,16 @@
1
+ /** API `flags.*` shape (client #815 / codexSdkYoloFlags). */
2
+ export declare const CODEX_COPRESENCE_YOLO_FLAGS: Readonly<{
3
+ approvalPolicy: "never";
4
+ sandboxMode: "danger-full-access";
5
+ skipGitRepoCheck: true;
6
+ }>;
7
+ /** Top-level Codex `config.toml` keys for the same posture. */
8
+ export declare const CODEX_COPRESENCE_YOLO_TOML: Readonly<{
9
+ approval_policy: "never";
10
+ sandbox_mode: "danger-full-access";
11
+ }>;
12
+ /** Fill missing yolo flags when a co-presence codex-app-server node is created. */
13
+ export declare function applyCodexCopresenceFlagDefaults(flags: Record<string, unknown>): void;
14
+ export declare function mergeCopresenceYoloIntoToml(existing: string): string;
15
+ /** Persist co-presence yolo posture under `<nodeDir>/codex-home/config.toml`. */
16
+ export declare function writeCopresenceYoloToCodexHome(codexHome: string): void;
@@ -26,6 +26,8 @@ export interface PreflightFacts {
26
26
  readonly dirMode: number | null;
27
27
  readonly authMode: number | null;
28
28
  readonly authBytes: number | null;
29
+ /** Selected custom env_key observed identically in owned Codex TUI/app-server. */
30
+ readonly providerEnvAttested?: boolean;
29
31
  readonly configTokenFingerprint: string | null;
30
32
  readonly envFileTokenFingerprint: string | null;
31
33
  };
@@ -0,0 +1,17 @@
1
+ /** Codex `config.toml` + `-c` override for thinking / reasoning effort.
2
+ * Wire name matches app-server JSON (`reasoningEffort`) and client patch field. */
3
+ export declare const CODEX_MODEL_REASONING_EFFORT_KEY = "model_reasoning_effort";
4
+ /** Matches agent-node `types/codex/ReasoningEffort.ts` and models_cache gate. */
5
+ export declare const REASONING_EFFORT_VALUES: readonly ["none", "minimal", "low", "medium", "high", "xhigh"];
6
+ export type ReasoningEffortValue = (typeof REASONING_EFFORT_VALUES)[number];
7
+ export declare function isReasoningEffortValue(v: unknown): v is ReasoningEffortValue;
8
+ export declare function reasoningEffortValidationReason(): string;
9
+ /** `-c` fragment value (no shell quoting). */
10
+ export declare function codexReasoningEffortConfigOverride(effort: ReasoningEffortValue): string;
11
+ /**
12
+ * Idempotent merge of top-level `model_reasoning_effort` in codex config.toml.
13
+ * Other tables and keys are preserved byte-for-byte except the managed line.
14
+ */
15
+ export declare function mergeModelReasoningEffortIntoToml(existing: string, effort: ReasoningEffortValue): string;
16
+ /** Persist `model_reasoning_effort` under a node's `codex-home/`. */
17
+ export declare function writeReasoningEffortToCodexHome(codexHome: string, effort: ReasoningEffortValue): void;
@@ -0,0 +1,35 @@
1
+ /** Local registry resolution shared by discovery/application; no remote path. */
2
+ export declare function resolveDaemonProviderTarget(nodesDir: string, target: {
3
+ node_id: string;
4
+ alias: string;
5
+ }, networkId: string): {
6
+ dir: string;
7
+ config: Record<string, any>;
8
+ };
9
+ export declare function scanDaemonCodex(nodesDir: string, targets: unknown, networkId: string, hostHome?: string): {
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
+ };
@@ -0,0 +1,32 @@
1
+ import { DaemonProviderStore } from './daemon-provider-store';
2
+ export declare function providerNodeRevision(nodeDir: string): string;
3
+ export declare function readProviderNodeConfig(nodeDir: string): Record<string, any>;
4
+ export declare function readProviderNodeToml(nodeDir: string): import("smol-toml").TomlTable;
5
+ export type ProviderApplicationRequest = {
6
+ requestId: string;
7
+ networkId: string;
8
+ daemonId: string;
9
+ nodeId: string;
10
+ alias: string;
11
+ nodeRevision: string;
12
+ revision: number;
13
+ providerId: string;
14
+ authId: string;
15
+ model: string;
16
+ confirmRestart: true;
17
+ };
18
+ export type ProviderActivation = {
19
+ nodeId: string;
20
+ model: string;
21
+ runtimeProvider: string;
22
+ nodeRevision: string;
23
+ };
24
+ export type ProviderApplicationLifecycle = {
25
+ preflight?: () => Promise<void>;
26
+ stopVerified: () => Promise<void>;
27
+ activate: (expected: ProviderActivation) => Promise<ProviderActivation>;
28
+ restore: () => Promise<void>;
29
+ };
30
+ /** Stop → private writes → verified activation. A crash leaves an explicit
31
+ * private recovery journal; reconnect must NOT blindly replay the mutation. */
32
+ export declare function applyDaemonProvider(nodeDir: string, store: DaemonProviderStore, request: ProviderApplicationRequest, lifecycle: ProviderApplicationLifecycle): Promise<any>;
@@ -0,0 +1,9 @@
1
+ import { type ProviderApplicationRequest } from './daemon-provider-application';
2
+ import { type ProviderCliRunner } from './daemon-provider-lifecycle';
3
+ export declare function runDaemonProviderApply(args: string[], deps: {
4
+ nodesDir: string;
5
+ readInput: () => string;
6
+ print: (text: string) => void;
7
+ run?: ProviderCliRunner;
8
+ authorizeIdle?: (daemonDir: string, request: ProviderApplicationRequest) => Promise<void>;
9
+ }): Promise<number>;
@@ -0,0 +1,7 @@
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)";
2
+ export declare function readProviderInput(fd?: number): string;
3
+ export declare function runDaemonProvider(args: string[], deps: {
4
+ nodesDir: string;
5
+ readInput: () => string;
6
+ print: (text: string) => void;
7
+ }): number;
@@ -0,0 +1,4 @@
1
+ import { type ProviderApplicationLifecycle, type ProviderApplicationRequest } from './daemon-provider-application';
2
+ export type ProviderCliRunner = (argv: string[], cwd: string, timeout: number) => Promise<string>;
3
+ export declare function providerCliRunner(binary: string, script: string, env: NodeJS.ProcessEnv): ProviderCliRunner;
4
+ export declare function providerApplicationLifecycle(nodeDir: string, request: ProviderApplicationRequest, run: ProviderCliRunner, authorizeIdle: () => Promise<void>): ProviderApplicationLifecycle;
@@ -0,0 +1,72 @@
1
+ export type ProviderAuthKind = "chatgpt" | "api_key";
2
+ export declare class DaemonProviderError extends Error {
3
+ readonly code: string;
4
+ constructor(code: string);
5
+ }
6
+ export declare class DaemonProviderStore {
7
+ private readonly root;
8
+ private readonly scope;
9
+ constructor(daemonDir: string);
10
+ private checkRoot;
11
+ private read;
12
+ private publicState;
13
+ list(): {
14
+ revision: number;
15
+ source: "daemon";
16
+ providers: {
17
+ id: string;
18
+ label: string;
19
+ enabled: boolean;
20
+ runtimes: {
21
+ runtime: "codex-tui";
22
+ auth: {
23
+ credential_present: boolean;
24
+ verification: "not_checked";
25
+ application: "not_applied";
26
+ baseUrl?: string | undefined;
27
+ id: string;
28
+ kind: ProviderAuthKind;
29
+ models: string[];
30
+ }[];
31
+ }[];
32
+ }[];
33
+ network_id: string;
34
+ daemon_node_id: string;
35
+ };
36
+ /** Local application lease. Secrets stay inside the daemon callback, never in list/scan. */
37
+ withApiKey<T>(selection: {
38
+ revision: number;
39
+ providerId: string;
40
+ authId: string;
41
+ model: string;
42
+ }, apply: (profile: {
43
+ providerId: string;
44
+ authId: string;
45
+ model: string;
46
+ baseUrl: string;
47
+ key: string;
48
+ }) => Promise<T>): Promise<T>;
49
+ upsert(value: unknown, expectedRevision: number, requestId?: string): {
50
+ revision: number;
51
+ source: "daemon";
52
+ providers: {
53
+ id: string;
54
+ label: string;
55
+ enabled: boolean;
56
+ runtimes: {
57
+ runtime: "codex-tui";
58
+ auth: {
59
+ credential_present: boolean;
60
+ verification: "not_checked";
61
+ application: "not_applied";
62
+ baseUrl?: string | undefined;
63
+ id: string;
64
+ kind: ProviderAuthKind;
65
+ models: string[];
66
+ }[];
67
+ }[];
68
+ }[];
69
+ network_id: string;
70
+ daemon_node_id: string;
71
+ };
72
+ }