@sleep2agi/agent-network 2.3.0-preview.161 → 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
- const a0_0x48433c=a0_0x25c5;(function(_0x46ea15,_0xf86193){const _0x3e2f9a=a0_0x25c5,_0x48b355=_0x46ea15();while(!![]){try{const _0x1e6afa=-parseInt(_0x3e2f9a(0x19c))/0x1+-parseInt(_0x3e2f9a(0x184))/0x2+-parseInt(_0x3e2f9a(0x1a0))/0x3+-parseInt(_0x3e2f9a(0x17f))/0x4*(-parseInt(_0x3e2f9a(0x1a3))/0x5)+-parseInt(_0x3e2f9a(0x196))/0x6*(-parseInt(_0x3e2f9a(0x1b2))/0x7)+-parseInt(_0x3e2f9a(0x1dc))/0x8*(-parseInt(_0x3e2f9a(0x199))/0x9)+-parseInt(_0x3e2f9a(0x1f2))/0xa*(-parseInt(_0x3e2f9a(0x1b1))/0xb);if(_0x1e6afa===_0xf86193)break;else _0x48b355['push'](_0x48b355['shift']());}catch(_0x283aa6){_0x48b355['push'](_0x48b355['shift']());}}}(a0_0xbe4d,0x3f44f));import{EventEmitter as a0_0x380af2}from'events';import{hostname as a0_0x106efe}from'os';var K=/(?:atok|ntok|utok|ghp|github_pat)_[A-Za-z0-9_-]+|Bearer\s+\S+/gi,L=(_0x1f4861,_0x55d04d)=>(_0x1f4861??_0x55d04d)[a0_0x48433c(0x1eb)](/[\r\n\x00-\x1f\x7f]/g,'\x20')[a0_0x48433c(0x1db)](0x0,0xf0);function N(_0x4d9f15){const _0x3edcc6=a0_0x48433c;return(_0x4d9f15 instanceof Error?_0x4d9f15[_0x3edcc6(0x1da)]:String(_0x4d9f15??'unknown\x20error'))[_0x3edcc6(0x1eb)](K,_0x3edcc6(0x18b))[_0x3edcc6(0x1eb)](/[\r\n\x00-\x1f\x7f]/g,'\x20')[_0x3edcc6(0x1db)](0x0,0xf0);}function O(_0x5112e6,_0x4ebefc=process.env.ANET_TASK_TRACE_FORMAT==='json'){const _0x2cecd0=a0_0x48433c;if(_0x4ebefc)return JSON[_0x2cecd0(0x19f)](_0x5112e6);let _0x1e83df=L(_0x5112e6['parent_task_id'],'<missing>'),_0x1e1b52=L(_0x5112e6['task_id'],_0x2cecd0(0x1ac)),_0x1b33ca=_0x5112e6[_0x2cecd0(0x1e1)]?'\x20error='+_0x5112e6[_0x2cecd0(0x1e1)]+':'+(_0x5112e6['error_message']??''):'';return _0x2cecd0(0x1be)+_0x5112e6[_0x2cecd0(0x19a)]+_0x2cecd0(0x1ae)+L(_0x5112e6[_0x2cecd0(0x1cd)],_0x2cecd0(0x194))+_0x2cecd0(0x1cb)+L(_0x5112e6['to_alias'],'<unknown>')+_0x2cecd0(0x1ca)+_0x1e1b52+_0x2cecd0(0x1d3)+_0x1e83df+_0x2cecd0(0x18f)+L(_0x5112e6[_0x2cecd0(0x1b0)],_0x2cecd0(0x194))+'\x20transport='+_0x5112e6[_0x2cecd0(0x1ba)]+'\x20duration_ms='+_0x5112e6[_0x2cecd0(0x1f5)]+_0x2cecd0(0x1ea)+_0x5112e6[_0x2cecd0(0x1d0)]+_0x1b33ca;}function a0_0xbe4d(){const _0x18b3ad=['application/json,\x20text/event-stream','result','293594XJfJpR','parentTaskId','startsWith','delivered','parse','report_status','now','[REDACTED]','cwd','signal','new_task','\x20network_id=','heartbeatTimer','reconnectDelay','heartbeatInterval','disconnect','<unknown>','error','220818NCEcyU','split','sending','72999AFTSCh','status','sleep','328649gIhkRV','toString','/events/','stringify','695559rteRBQ','call','offline','854020VveXXY','send_failed','data:\x20','min','task.started','token','name','failed','connectSSE','<pending>','sdk','\x20from=',']\x20[commhub:','network_id','165ayXvtG','14OvMOow','content','autoConnect','SSE\x20connected','get_inbox','running','send_rejected','task','transport','Authorization','sseAbort','agent','[commhub:task]\x20','connected','new_message','from_session','AbortError','fromAlias','emit','send','inbox\x20error:\x20','match','decode','POST','\x20task_id=','\x20to=','task.ack','from_alias','catch','Bearer\x20','lifecycle_tracking','networkId','broadcast','\x20parent_task_id=','log','task.send.failed','text','messages','SSE\x20error:\x20','SSE\x20reconnecting\x20in\x20','message','slice','88aLxMBb','CommHub\x20response\x20omitted\x20task_id','alias','connect','/mcp','error_code','resumeId','not_tracked','type','disconnected','text/event-stream','reply','send_message','processInbox','\x20lifecycle=','replace','read','normal','missing_task_id','ack_inbox','idle','SSE\x20failed:\x20','308010RkKMuC','task.replied','message_id','duration_ms','toAlias','8nMwYOd','url','getAllStatus'];a0_0xbe4d=function(){return _0x18b3ad;};return a0_0xbe4d();}function U(_0x443d5a){const _0x5f2337=a0_0x48433c;return{'event':{'sending':'task.send.start','delivered':'task.send.delivered','failed':_0x5f2337(0x1d5),'acked':_0x5f2337(0x1cc),'started':_0x5f2337(0x1a7),'replied':_0x5f2337(0x1f3),'expired':'task.expired'}[_0x443d5a['status']],..._0x443d5a};}function j(_0x2d5dcc){const _0xd8436b=a0_0x48433c;let _0x548b7d=_0x2d5dcc?.['task_id']||_0x2d5dcc?.[_0xd8436b(0x1f4)]||_0x2d5dcc?.['id'];if(_0x548b7d)return String(_0x548b7d);let _0x1e5f66=_0x2d5dcc?.[_0xd8436b(0x1b3)]?.[0x0]?.[_0xd8436b(0x1d6)];if(typeof _0x1e5f66!=='string')return null;try{let _0x3a88b6=JSON['parse'](_0x1e5f66);return _0x3a88b6?.['task_id']||_0x3a88b6?.[_0xd8436b(0x1f4)]||_0x3a88b6?.['id']||null;}catch{return null;}}async function X(_0x4c70b6,_0xe12a0f){const _0x6fc10d=a0_0x48433c;let _0xc9fad1=_0xe12a0f[_0x6fc10d(0x18a)]??Date[_0x6fc10d(0x18a)],_0x27ca03=_0xc9fad1(),_0x128507=(_0x4531d6,_0x3de46c,_0xe9eb4f,_0x2cef04)=>{const _0x462bab=_0x6fc10d;_0xe12a0f['log'](O(U({'from_alias':_0x4c70b6[_0x462bab(0x1c3)],'to_alias':_0x4c70b6[_0x462bab(0x1f6)],'task_id':_0x3de46c,'parent_task_id':_0x4c70b6[_0x462bab(0x185)],'network_id':_0x4c70b6[_0x462bab(0x1d1)],'transport':_0x4c70b6['transport'],'status':_0x4531d6,'duration_ms':_0xc9fad1()-_0x27ca03,'lifecycle_tracking':_0x4c70b6['lifecycleTracking'],..._0xe9eb4f!==void 0x0?{'error_code':_0x2cef04||_0x462bab(0x1a4),'error_message':N(_0xe9eb4f)}:{}})));};_0x128507(_0x6fc10d(0x198),null);try{let _0x1ecd39=await _0xe12a0f['send'](),_0x1b32de=j(_0x1ecd39);if(_0x1b32de)_0x128507(_0x6fc10d(0x187),_0x1b32de);else{if(_0x1ecd39?.['ok']===!0x1||_0x1ecd39?.[_0x6fc10d(0x195)])_0x128507(_0x6fc10d(0x1aa),_0x1b32de,_0x1ecd39?.[_0x6fc10d(0x195)]||'CommHub\x20rejected\x20task',_0x6fc10d(0x1b8));else _0x128507(_0x6fc10d(0x1aa),null,_0x6fc10d(0x1dd),_0x6fc10d(0x1ee));}return _0x1ecd39;}catch(_0x13b6cd){throw _0x128507(_0x6fc10d(0x1aa),null,_0x13b6cd,_0x6fc10d(0x1a4)),_0x13b6cd;}}function a0_0x25c5(_0x3eccf3,_0x49d5ba){_0x3eccf3=_0x3eccf3-0x17f;const _0xbe4da1=a0_0xbe4d();let _0x25c58d=_0xbe4da1[_0x3eccf3];return _0x25c58d;}async function Y(_0x1fcaa8,_0x1d0a6c){const _0x44c82f=a0_0x48433c;return X({'fromAlias':_0x1fcaa8[_0x44c82f(0x1c3)],'toAlias':_0x1fcaa8[_0x44c82f(0x1de)],'parentTaskId':_0x1fcaa8[_0x44c82f(0x185)]||null,'networkId':_0x1fcaa8[_0x44c82f(0x1d1)]||null,'transport':'mcp_http','lifecycleTracking':_0x44c82f(0x1e3)},_0x1d0a6c);}class $ extends a0_0x380af2{[a0_0x48433c(0x180)];[a0_0x48433c(0x1de)];[a0_0x48433c(0x1a8)];[a0_0x48433c(0x1bd)];[a0_0x48433c(0x1e2)];[a0_0x48433c(0x192)];[a0_0x48433c(0x191)];[a0_0x48433c(0x190)];[a0_0x48433c(0x1bc)];[a0_0x48433c(0x1b7)]=!0x1;constructor(_0x14f07d){const _0x1ee3a1=a0_0x48433c;super();if(this[_0x1ee3a1(0x180)]=_0x14f07d[_0x1ee3a1(0x180)][_0x1ee3a1(0x1eb)](/\/$/,''),this[_0x1ee3a1(0x1de)]=_0x14f07d[_0x1ee3a1(0x1de)],this[_0x1ee3a1(0x1a8)]=_0x14f07d[_0x1ee3a1(0x1a8)],this[_0x1ee3a1(0x1bd)]=_0x14f07d[_0x1ee3a1(0x1bd)]||_0x1ee3a1(0x1ad),this[_0x1ee3a1(0x1e2)]='sdk-'+_0x14f07d['alias']+'-'+Date[_0x1ee3a1(0x18a)]()[_0x1ee3a1(0x19d)](0x24),this['heartbeatInterval']=_0x14f07d['heartbeatInterval']??0x2bf20,this[_0x1ee3a1(0x191)]=_0x14f07d[_0x1ee3a1(0x191)]??0xbb8,_0x14f07d[_0x1ee3a1(0x1b4)]!==!0x1)this[_0x1ee3a1(0x1df)]();}[a0_0x48433c(0x1d4)](_0x26730f){const _0xf9f10b=a0_0x48433c;console[_0xf9f10b(0x1d4)]('['+new Date()['toTimeString']()[_0xf9f10b(0x1db)](0x0,0x8)+_0xf9f10b(0x1af)+this[_0xf9f10b(0x1de)]+']\x20'+_0x26730f);}async[a0_0x48433c(0x1a1)](_0x38469f,_0x8003aa){const _0x21c350=a0_0x48433c;let _0x184cbb={'Content-Type':'application/json','Accept':_0x21c350(0x182)};if(this[_0x21c350(0x1a8)])_0x184cbb['Authorization']=_0x21c350(0x1cf)+this[_0x21c350(0x1a8)];let _0x1aa8a8=await(await fetch(this[_0x21c350(0x180)]+_0x21c350(0x1e0),{'method':_0x21c350(0x1c9),'headers':_0x184cbb,'body':JSON[_0x21c350(0x19f)]({'jsonrpc':'2.0','id':Date['now'](),'method':'tools/call','params':{'name':_0x38469f,'arguments':_0x8003aa}})}))[_0x21c350(0x1d6)](),_0x1e6d03=_0x1aa8a8[_0x21c350(0x1c7)](/data: (.+)/),_0x4d9cdc=_0x1e6d03?JSON[_0x21c350(0x188)](_0x1e6d03[0x1]):JSON[_0x21c350(0x188)](_0x1aa8a8),_0x168189=_0x4d9cdc?.[_0x21c350(0x183)]?.[_0x21c350(0x1b3)]?.[0x0]?.['text'];return _0x168189?JSON[_0x21c350(0x188)](_0x168189):_0x4d9cdc;}async[a0_0x48433c(0x1df)](){const _0x5ef9d2=a0_0x48433c;if(this['running'])return;this[_0x5ef9d2(0x1b7)]=!0x0,await this['status']('idle'),this[_0x5ef9d2(0x1d4)]('registered'),this['heartbeatTimer']=setInterval(()=>{const _0x1a596e=_0x5ef9d2;this[_0x1a596e(0x19a)](_0x1a596e(0x1f0))['catch'](_0x2c4857=>this['log']('heartbeat\x20failed:\x20'+_0x2c4857[_0x1a596e(0x1da)]));},this[_0x5ef9d2(0x192)]),this[_0x5ef9d2(0x1ab)]();}async[a0_0x48433c(0x193)](){const _0x117d6f=a0_0x48433c;if(this['running']=!0x1,this[_0x117d6f(0x1bc)]?.['abort'](),this[_0x117d6f(0x190)])clearInterval(this[_0x117d6f(0x190)]);await this[_0x117d6f(0x19a)](_0x117d6f(0x1a2))[_0x117d6f(0x1ce)](()=>{}),this[_0x117d6f(0x1d4)](_0x117d6f(0x1e5));}async[a0_0x48433c(0x1c5)](_0x507688,_0x4d2652,_0x1d9aa9=a0_0x48433c(0x1ed)){const _0x18b33b=a0_0x48433c;return Y({'alias':_0x507688,'fromAlias':this['alias']},{'log':_0x53e914=>console[_0x18b33b(0x1d4)](_0x53e914),'send':()=>this[_0x18b33b(0x1a1)]('send_task',{'alias':_0x507688,'task':_0x4d2652,'priority':_0x1d9aa9,'from_session':this['alias']})});}async[a0_0x48433c(0x1da)](_0x222f0e,_0x2443ac){const _0xd27eb=a0_0x48433c;return this[_0xd27eb(0x1a1)](_0xd27eb(0x1e8),{'alias':_0x222f0e,'message':_0x2443ac,'from_session':this['alias']});}async[a0_0x48433c(0x1e7)](_0x3ee7ff,_0x3b5a09,_0x348637='completed'){return this['call']('send_reply',{'in_reply_to':_0x3ee7ff,'text':_0x3b5a09,'status':_0x348637});}async[a0_0x48433c(0x19a)](_0x19c6f1,_0x3ac224){const _0x39e811=a0_0x48433c;return this[_0x39e811(0x1a1)](_0x39e811(0x189),{'resume_id':this[_0x39e811(0x1e2)],'alias':this['alias'],'status':_0x19c6f1,'server':a0_0x106efe(),'hostname':a0_0x106efe(),'agent':this[_0x39e811(0x1bd)],'project_dir':process[_0x39e811(0x18c)](),..._0x3ac224});}async[a0_0x48433c(0x181)](){return this['call']('get_all_status',{});}async[a0_0x48433c(0x1d2)](_0x415ea4,_0x2a7b72){const _0x88ef61=a0_0x48433c;return this[_0x88ef61(0x1a1)](_0x88ef61(0x1d2),{'message':_0x415ea4,'filter_server':_0x2a7b72?.['server'],'filter_status':_0x2a7b72?.[_0x88ef61(0x19a)]});}async[a0_0x48433c(0x1ab)](){const _0x77362f=a0_0x48433c;let _0x285b8b=encodeURIComponent(this[_0x77362f(0x1de)]),_0x393a6b=this['url']+_0x77362f(0x19e)+_0x285b8b,_0x51c2c8=this[_0x77362f(0x191)];while(this['running']){try{this[_0x77362f(0x1bc)]=new AbortController();let _0x22fca9={'Accept':_0x77362f(0x1e6)};if(this['token'])_0x22fca9[_0x77362f(0x1bb)]='Bearer\x20'+this[_0x77362f(0x1a8)];let _0x31343f=await fetch(_0x393a6b,{'headers':_0x22fca9,'signal':this[_0x77362f(0x1bc)][_0x77362f(0x18d)]});if(!_0x31343f['ok']||!_0x31343f['body']){this['log'](_0x77362f(0x1f1)+_0x31343f['status']),await this[_0x77362f(0x19b)](_0x51c2c8),_0x51c2c8=Math[_0x77362f(0x1a6)](_0x51c2c8*1.5,0xea60);continue;}_0x51c2c8=this[_0x77362f(0x191)];let _0x5a6963=_0x31343f['body']['getReader'](),_0x109d8c=new TextDecoder(),_0x32f459='';while(this[_0x77362f(0x1b7)]){let {done:_0xf4de4e,value:_0x3dd999}=await _0x5a6963[_0x77362f(0x1ec)]();if(_0xf4de4e)break;_0x32f459+=_0x109d8c[_0x77362f(0x1c8)](_0x3dd999,{'stream':!0x0});let _0x296e81=_0x32f459[_0x77362f(0x197)]('\x0a');_0x32f459=_0x296e81['pop']()||'';for(let _0x2ae7a6 of _0x296e81){if(!_0x2ae7a6[_0x77362f(0x186)](_0x77362f(0x1a5)))continue;try{let _0x572285=JSON[_0x77362f(0x188)](_0x2ae7a6[_0x77362f(0x1db)](0x6));if(_0x572285['type']===_0x77362f(0x1bf)){this['log'](_0x77362f(0x1b5)),this[_0x77362f(0x1c4)](_0x77362f(0x1bf));continue;}if(_0x572285[_0x77362f(0x1e4)]===_0x77362f(0x18e)||_0x572285[_0x77362f(0x1e4)]===_0x77362f(0x1c0)||_0x572285[_0x77362f(0x1e4)]===_0x77362f(0x1d2))await this[_0x77362f(0x1e9)]();}catch{}}}}catch(_0x2a2b85){if(_0x2a2b85[_0x77362f(0x1a9)]===_0x77362f(0x1c2))break;this[_0x77362f(0x1c4)]('error',_0x2a2b85),this[_0x77362f(0x1d4)](_0x77362f(0x1d8)+_0x2a2b85[_0x77362f(0x1da)]);}if(this[_0x77362f(0x1b7)])this[_0x77362f(0x1c4)]('disconnected'),this[_0x77362f(0x1d4)](_0x77362f(0x1d9)+_0x51c2c8/0x3e8+'s...'),await this[_0x77362f(0x19b)](_0x51c2c8),_0x51c2c8=Math[_0x77362f(0x1a6)](_0x51c2c8*1.5,0xea60);}}async[a0_0x48433c(0x1e9)](){const _0x4c7a09=a0_0x48433c;try{let _0x21f5e2=(await this[_0x4c7a09(0x1a1)](_0x4c7a09(0x1b6),{'alias':this[_0x4c7a09(0x1de)],'limit':0xa}))?.[_0x4c7a09(0x1d7)]||[];for(let _0x36fefa of _0x21f5e2)await this[_0x4c7a09(0x1a1)](_0x4c7a09(0x1ef),{'alias':this[_0x4c7a09(0x1de)],'message_id':_0x36fefa['id']}),this[_0x4c7a09(0x1d4)]('←\x20'+_0x36fefa[_0x4c7a09(0x1c1)]+':\x20'+_0x36fefa['content'][_0x4c7a09(0x1db)](0x0,0x3c)),this[_0x4c7a09(0x1c4)](_0x4c7a09(0x1b9),_0x36fefa),this[_0x4c7a09(0x1c4)]('message',_0x36fefa);}catch(_0x369a2a){this[_0x4c7a09(0x1d4)](_0x4c7a09(0x1c6)+_0x369a2a[_0x4c7a09(0x1da)]);}}[a0_0x48433c(0x19b)](_0x59db37){return new Promise(_0x4088ea=>setTimeout(_0x4088ea,_0x59db37));}}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
+ }