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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
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};
1
+ const a0_0x550e5e=a0_0x454b;(function(_0x5d3164,_0x248582){const _0x3f1474=a0_0x454b,_0x4354c7=_0x5d3164();while(!![]){try{const _0x23dfc8=-parseInt(_0x3f1474(0xcc))/0x1*(-parseInt(_0x3f1474(0xc3))/0x2)+-parseInt(_0x3f1474(0x96))/0x3+-parseInt(_0x3f1474(0x82))/0x4*(parseInt(_0x3f1474(0x74))/0x5)+-parseInt(_0x3f1474(0xae))/0x6+parseInt(_0x3f1474(0xee))/0x7*(parseInt(_0x3f1474(0xa2))/0x8)+parseInt(_0x3f1474(0xcf))/0x9*(-parseInt(_0x3f1474(0xa8))/0xa)+parseInt(_0x3f1474(0xb6))/0xb*(parseInt(_0x3f1474(0xc8))/0xc);if(_0x23dfc8===_0x248582)break;else _0x4354c7['push'](_0x4354c7['shift']());}catch(_0x4692ba){_0x4354c7['push'](_0x4354c7['shift']());}}}(a0_0x5bad,0x8120f));function a0_0x454b(_0x2bc4d,_0x28d04b){_0x2bc4d=_0x2bc4d-0x6e;const _0x5badd4=a0_0x5bad();let _0x454b5f=_0x5badd4[_0x2bc4d];return _0x454b5f;}import{EventEmitter as a0_0x4da2cc}from'events';import{hostname as a0_0xeea49b}from'os';var K=/(?:atok|ntok|utok|ghp|github_pat)_[A-Za-z0-9_-]+|Bearer\s+\S+/gi,L=(_0xd9073e,_0x356d19)=>(_0xd9073e??_0x356d19)[a0_0x550e5e(0xeb)](/[\r\n\x00-\x1f\x7f]/g,'\x20')[a0_0x550e5e(0xc0)](0x0,0xf0);function N(_0x46f4ba){const _0x21280f=a0_0x550e5e;return(_0x46f4ba instanceof Error?_0x46f4ba[_0x21280f(0xea)]:String(_0x46f4ba??_0x21280f(0x7c)))[_0x21280f(0xeb)](K,_0x21280f(0xbf))[_0x21280f(0xeb)](/[\r\n\x00-\x1f\x7f]/g,'\x20')[_0x21280f(0xc0)](0x0,0xf0);}function O(_0xb049e9,_0x2f9c94=process.env.ANET_TASK_TRACE_FORMAT==='json'){const _0x38c803=a0_0x550e5e;if(_0x2f9c94)return JSON[_0x38c803(0xb9)](_0xb049e9);let _0xaf8946=L(_0xb049e9[_0x38c803(0x70)],'<missing>'),_0x89adbf=L(_0xb049e9[_0x38c803(0xc2)],_0x38c803(0x88)),_0x32e7bb=_0xb049e9[_0x38c803(0xe1)]?_0x38c803(0xe9)+_0xb049e9[_0x38c803(0xe1)]+':'+(_0xb049e9[_0x38c803(0xe3)]??''):'';return _0x38c803(0xcb)+_0xb049e9[_0x38c803(0xb8)]+_0x38c803(0xd3)+L(_0xb049e9[_0x38c803(0xb5)],_0x38c803(0xa3))+_0x38c803(0x84)+L(_0xb049e9['to_alias'],_0x38c803(0xa3))+'\x20task_id='+_0x89adbf+_0x38c803(0x98)+_0xaf8946+'\x20network_id='+L(_0xb049e9['network_id'],_0x38c803(0xa3))+_0x38c803(0x86)+_0xb049e9['transport']+'\x20duration_ms='+_0xb049e9[_0x38c803(0xc4)]+_0x38c803(0x8d)+_0xb049e9['lifecycle_tracking']+_0x32e7bb;}function U(_0x503960){const _0x4dace1=a0_0x550e5e;return{'event':{'sending':_0x4dace1(0x8f),'delivered':_0x4dace1(0xdc),'failed':_0x4dace1(0xe4),'acked':_0x4dace1(0x6e),'started':_0x4dace1(0x97),'replied':'task.replied','expired':_0x4dace1(0xc7)}[_0x503960[_0x4dace1(0xb8)]],..._0x503960};}function j(_0xd3cc25){const _0x27c330=a0_0x550e5e;let _0x3716be=_0xd3cc25?.[_0x27c330(0xc2)]||_0xd3cc25?.[_0x27c330(0xd0)]||_0xd3cc25?.['id'];if(_0x3716be)return String(_0x3716be);let _0x4e816b=_0xd3cc25?.['content']?.[0x0]?.[_0x27c330(0xad)];if(typeof _0x4e816b!==_0x27c330(0xd4))return null;try{let _0x38bf7f=JSON[_0x27c330(0xac)](_0x4e816b);return _0x38bf7f?.[_0x27c330(0xc2)]||_0x38bf7f?.['message_id']||_0x38bf7f?.['id']||null;}catch{return null;}}async function X(_0xbaac3a,_0x49f54d){const _0x5cee60=a0_0x550e5e;let _0x12d832=_0x49f54d[_0x5cee60(0x94)]??Date['now'],_0x5b8476=_0x12d832(),_0x2303ae=(_0x46dd14,_0x3bbc57,_0x41be2e,_0x361df9)=>{const _0x34e931=_0x5cee60;_0x49f54d[_0x34e931(0x8c)](O(U({'from_alias':_0xbaac3a[_0x34e931(0x80)],'to_alias':_0xbaac3a[_0x34e931(0xc9)],'task_id':_0x3bbc57,'parent_task_id':_0xbaac3a[_0x34e931(0x7f)],'network_id':_0xbaac3a[_0x34e931(0x76)],'transport':_0xbaac3a[_0x34e931(0x79)],'status':_0x46dd14,'duration_ms':_0x12d832()-_0x5b8476,'lifecycle_tracking':_0xbaac3a[_0x34e931(0x83)],..._0x41be2e!==void 0x0?{'error_code':_0x361df9||_0x34e931(0xaa),'error_message':N(_0x41be2e)}:{}})));};_0x2303ae(_0x5cee60(0x9b),null);try{let _0xc6a566=await _0x49f54d[_0x5cee60(0x71)](),_0x552c89=j(_0xc6a566);if(_0x552c89)_0x2303ae(_0x5cee60(0x9f),_0x552c89);else{if(_0xc6a566?.['ok']===!0x1||_0xc6a566?.['error'])_0x2303ae('failed',_0x552c89,_0xc6a566?.[_0x5cee60(0xd8)]||_0x5cee60(0xb1),'send_rejected');else _0x2303ae(_0x5cee60(0xe0),null,_0x5cee60(0xa4),_0x5cee60(0x93));}return _0xc6a566;}catch(_0x4342e8){throw _0x2303ae(_0x5cee60(0xe0),null,_0x4342e8,_0x5cee60(0xaa)),_0x4342e8;}}async function Y(_0x402f9e,_0x5c12fd){const _0x85688c=a0_0x550e5e;return X({'fromAlias':_0x402f9e[_0x85688c(0x80)],'toAlias':_0x402f9e[_0x85688c(0x7d)],'parentTaskId':_0x402f9e[_0x85688c(0x7f)]||null,'networkId':_0x402f9e[_0x85688c(0x76)]||null,'transport':_0x85688c(0xd7),'lifecycleTracking':_0x85688c(0xa5)},_0x5c12fd);}class $ extends a0_0x4da2cc{['url'];[a0_0x550e5e(0x7d)];['token'];['agent'];[a0_0x550e5e(0x99)];[a0_0x550e5e(0xa0)];[a0_0x550e5e(0xd2)];[a0_0x550e5e(0x9d)];[a0_0x550e5e(0xce)];[a0_0x550e5e(0xd1)]=!0x1;constructor(_0x223f70){const _0x55d00a=a0_0x550e5e;super();if(this[_0x55d00a(0x92)]=_0x223f70[_0x55d00a(0x92)][_0x55d00a(0xeb)](/\/$/,''),this['alias']=_0x223f70[_0x55d00a(0x7d)],this[_0x55d00a(0xdb)]=_0x223f70[_0x55d00a(0xdb)],this[_0x55d00a(0x7a)]=_0x223f70[_0x55d00a(0x7a)]||_0x55d00a(0x91),this[_0x55d00a(0x99)]=_0x55d00a(0xc1)+_0x223f70[_0x55d00a(0x7d)]+'-'+Date[_0x55d00a(0x94)]()[_0x55d00a(0xdd)](0x24),this[_0x55d00a(0xa0)]=_0x223f70[_0x55d00a(0xa0)]??0x2bf20,this[_0x55d00a(0xd2)]=_0x223f70['reconnectDelay']??0xbb8,_0x223f70[_0x55d00a(0x72)]!==!0x1)this[_0x55d00a(0x89)]();}[a0_0x550e5e(0x8c)](_0x413b6b){const _0x568a2a=a0_0x550e5e;console[_0x568a2a(0x8c)]('['+new Date()[_0x568a2a(0xe6)]()[_0x568a2a(0xc0)](0x0,0x8)+_0x568a2a(0x73)+this[_0x568a2a(0x7d)]+']\x20'+_0x413b6b);}async[a0_0x550e5e(0xbe)](_0x5ac407,_0x315820){const _0x307eea=a0_0x550e5e;let _0x168ee8={'Content-Type':'application/json','Accept':'application/json,\x20text/event-stream'};if(this[_0x307eea(0xdb)])_0x168ee8[_0x307eea(0x75)]=_0x307eea(0xb3)+this[_0x307eea(0xdb)];let _0xc85a33=await(await fetch(this[_0x307eea(0x92)]+'/mcp',{'method':'POST','headers':_0x168ee8,'body':JSON[_0x307eea(0xb9)]({'jsonrpc':_0x307eea(0xbb),'id':Date[_0x307eea(0x94)](),'method':_0x307eea(0x7b),'params':{'name':_0x5ac407,'arguments':_0x315820}})}))[_0x307eea(0xad)](),_0x160ca6=_0xc85a33['match'](/data: (.+)/),_0x1dc06a=_0x160ca6?JSON[_0x307eea(0xac)](_0x160ca6[0x1]):JSON[_0x307eea(0xac)](_0xc85a33),_0xdc0f8c=_0x1dc06a?.[_0x307eea(0xcd)]?.['content']?.[0x0]?.[_0x307eea(0xad)];return _0xdc0f8c?JSON['parse'](_0xdc0f8c):_0x1dc06a;}async[a0_0x550e5e(0x89)](){const _0x597786=a0_0x550e5e;if(this[_0x597786(0xd1)])return;this['running']=!0x0,await this[_0x597786(0xb8)](_0x597786(0x9e)),this[_0x597786(0x8c)](_0x597786(0xc5)),this[_0x597786(0x9d)]=setInterval(()=>{const _0x242951=_0x597786;this[_0x242951(0xb8)](_0x242951(0x9e))['catch'](_0x50ebc6=>this[_0x242951(0x8c)]('heartbeat\x20failed:\x20'+_0x50ebc6[_0x242951(0xea)]));},this[_0x597786(0xa0)]),this[_0x597786(0xd6)]();}async[a0_0x550e5e(0xc6)](){const _0x5d6fbd=a0_0x550e5e;if(this[_0x5d6fbd(0xd1)]=!0x1,this['sseAbort']?.['abort'](),this[_0x5d6fbd(0x9d)])clearInterval(this['heartbeatTimer']);await this[_0x5d6fbd(0xb8)](_0x5d6fbd(0xbc))[_0x5d6fbd(0x81)](()=>{}),this['log']('disconnected');}async[a0_0x550e5e(0x71)](_0x3860a4,_0x31e0a8,_0x2f7e94=a0_0x550e5e(0x90)){const _0x44634e=a0_0x550e5e;return Y({'alias':_0x3860a4,'fromAlias':this['alias']},{'log':_0x67e2e4=>console[_0x44634e(0x8c)](_0x67e2e4),'send':()=>this[_0x44634e(0xbe)]('send_task',{'alias':_0x3860a4,'task':_0x31e0a8,'priority':_0x2f7e94,'from_session':this['alias']})});}async[a0_0x550e5e(0xea)](_0x434d91,_0x2f1b56){const _0x2155b7=a0_0x550e5e;return this['call']('send_message',{'alias':_0x434d91,'message':_0x2f1b56,'from_session':this[_0x2155b7(0x7d)]});}async[a0_0x550e5e(0x9a)](_0x147d74,_0x451bea,_0x12c0c5=a0_0x550e5e(0xb2)){const _0x577287=a0_0x550e5e;return this['call'](_0x577287(0xde),{'in_reply_to':_0x147d74,'text':_0x451bea,'status':_0x12c0c5});}async[a0_0x550e5e(0xb8)](_0x2060d4,_0x18096b){const _0x31143b=a0_0x550e5e;return this[_0x31143b(0xbe)](_0x31143b(0xbd),{'resume_id':this['resumeId'],'alias':this[_0x31143b(0x7d)],'status':_0x2060d4,'server':a0_0xeea49b(),'hostname':a0_0xeea49b(),'agent':this[_0x31143b(0x7a)],'project_dir':process[_0x31143b(0xa9)](),..._0x18096b});}async['getAllStatus'](){const _0x1e7bf8=a0_0x550e5e;return this[_0x1e7bf8(0xbe)](_0x1e7bf8(0xa6),{});}async['broadcast'](_0x394916,_0x11212a){const _0x31df29=a0_0x550e5e;return this[_0x31df29(0xbe)](_0x31df29(0xab),{'message':_0x394916,'filter_server':_0x11212a?.[_0x31df29(0x85)],'filter_status':_0x11212a?.[_0x31df29(0xb8)]});}async[a0_0x550e5e(0xd6)](){const _0x4c37f6=a0_0x550e5e;let _0x4c3cd2=encodeURIComponent(this[_0x4c37f6(0x7d)]),_0x2aba8e=this[_0x4c37f6(0x92)]+_0x4c37f6(0xa7)+_0x4c3cd2,_0x4d40c6=this[_0x4c37f6(0xd2)];while(this[_0x4c37f6(0xd1)]){try{this['sseAbort']=new AbortController();let _0x475615={'Accept':'text/event-stream'};if(this['token'])_0x475615[_0x4c37f6(0x75)]=_0x4c37f6(0xb3)+this[_0x4c37f6(0xdb)];let _0x2519f6=await fetch(_0x2aba8e,{'headers':_0x475615,'signal':this[_0x4c37f6(0xce)][_0x4c37f6(0xb4)]});if(!_0x2519f6['ok']||!_0x2519f6['body']){this['log'](_0x4c37f6(0x7e)+_0x2519f6[_0x4c37f6(0xb8)]),await this[_0x4c37f6(0xd9)](_0x4d40c6),_0x4d40c6=Math[_0x4c37f6(0xdf)](_0x4d40c6*1.5,0xea60);continue;}_0x4d40c6=this[_0x4c37f6(0xd2)];let _0x5cef41=_0x2519f6[_0x4c37f6(0xa1)]['getReader'](),_0x5877df=new TextDecoder(),_0x5754c4='';while(this['running']){let {done:_0x236d6a,value:_0x37fb7c}=await _0x5cef41[_0x4c37f6(0xda)]();if(_0x236d6a)break;_0x5754c4+=_0x5877df['decode'](_0x37fb7c,{'stream':!0x0});let _0x15f31c=_0x5754c4[_0x4c37f6(0xe5)]('\x0a');_0x5754c4=_0x15f31c[_0x4c37f6(0xed)]()||'';for(let _0x2cdfa5 of _0x15f31c){if(!_0x2cdfa5['startsWith'](_0x4c37f6(0x6f)))continue;try{let _0x3ffab6=JSON[_0x4c37f6(0xac)](_0x2cdfa5['slice'](0x6));if(_0x3ffab6[_0x4c37f6(0xe7)]==='connected'){this[_0x4c37f6(0x8c)](_0x4c37f6(0xd5)),this[_0x4c37f6(0xb7)](_0x4c37f6(0xb0));continue;}if(_0x3ffab6[_0x4c37f6(0xe7)]===_0x4c37f6(0x77)||_0x3ffab6[_0x4c37f6(0xe7)]==='new_message'||_0x3ffab6['type']===_0x4c37f6(0xab))await this['processInbox']();}catch{}}}}catch(_0x1bd23e){if(_0x1bd23e[_0x4c37f6(0x87)]===_0x4c37f6(0xca))break;this[_0x4c37f6(0xb7)](_0x4c37f6(0xd8),_0x1bd23e),this[_0x4c37f6(0x8c)](_0x4c37f6(0x8b)+_0x1bd23e[_0x4c37f6(0xea)]);}if(this[_0x4c37f6(0xd1)])this[_0x4c37f6(0xb7)](_0x4c37f6(0x8e)),this[_0x4c37f6(0x8c)](_0x4c37f6(0xec)+_0x4d40c6/0x3e8+_0x4c37f6(0xaf)),await this[_0x4c37f6(0xd9)](_0x4d40c6),_0x4d40c6=Math[_0x4c37f6(0xdf)](_0x4d40c6*1.5,0xea60);}}async[a0_0x550e5e(0xba)](){const _0x50cf57=a0_0x550e5e;try{let _0x5a459d=(await this[_0x50cf57(0xbe)](_0x50cf57(0xe8),{'alias':this[_0x50cf57(0x7d)],'limit':0xa}))?.[_0x50cf57(0x8a)]||[];for(let _0x135885 of _0x5a459d)await this[_0x50cf57(0xbe)]('ack_inbox',{'alias':this['alias'],'message_id':_0x135885['id']}),this[_0x50cf57(0x8c)]('←\x20'+_0x135885[_0x50cf57(0x9c)]+':\x20'+_0x135885[_0x50cf57(0x78)][_0x50cf57(0xc0)](0x0,0x3c)),this[_0x50cf57(0xb7)](_0x50cf57(0x95),_0x135885),this[_0x50cf57(0xb7)](_0x50cf57(0xea),_0x135885);}catch(_0x1d6555){this[_0x50cf57(0x8c)](_0x50cf57(0xe2)+_0x1d6555[_0x50cf57(0xea)]);}}['sleep'](_0x567be2){return new Promise(_0x3e8e32=>setTimeout(_0x3e8e32,_0x567be2));}}var F=$;export{F as default,$ as CommHub};function a0_0x5bad(){const _0x1e5dcf=['CommHub\x20response\x20omitted\x20task_id','not_tracked','get_all_status','/events/','10190kBgzlD','cwd','send_failed','broadcast','parse','text','4581036MmNpDD','s...','connected','CommHub\x20rejected\x20task','completed','Bearer\x20','signal','from_alias','11FXhjQk','emit','status','stringify','processInbox','2.0','offline','report_status','call','[REDACTED]','slice','sdk-','task_id','905758VWETMy','duration_ms','registered','disconnect','task.expired','12978924lRQwpV','toAlias','AbortError','[commhub:task]\x20','2TudWVK','result','sseAbort','8757hCdqkb','message_id','running','reconnectDelay','\x20from=','string','SSE\x20connected','connectSSE','mcp_http','error','sleep','read','token','task.send.delivered','toString','send_reply','min','failed','error_code','inbox\x20error:\x20','error_message','task.send.failed','split','toTimeString','type','get_inbox','\x20error=','message','replace','SSE\x20reconnecting\x20in\x20','pop','7FxncUR','task.ack','data:\x20','parent_task_id','send','autoConnect',']\x20[commhub:','306635KSSUFa','Authorization','networkId','new_task','content','transport','agent','tools/call','unknown\x20error','alias','SSE\x20failed:\x20','parentTaskId','fromAlias','catch','4YrlMob','lifecycleTracking','\x20to=','server','\x20transport=','name','<pending>','connect','messages','SSE\x20error:\x20','log','\x20lifecycle=','disconnected','task.send.start','normal','sdk','url','missing_task_id','now','task','960780qByoeM','task.started','\x20parent_task_id=','resumeId','reply','sending','from_session','heartbeatTimer','idle','delivered','heartbeatInterval','body','5425248YGkeuV','<unknown>'];a0_0x5bad=function(){return _0x1e5dcf;};return a0_0x5bad();}
@@ -1,5 +1,6 @@
1
1
  import { type CodexRecoveryVerification } from "./codex-copresence-recovery";
2
2
  export declare const SAFE_CODEX_THREAD_ID: RegExp;
3
+ export declare function defaultWebSocketCtor(maxPayload: number): Promise<any>;
3
4
  /** Minimal JSON-RPC client used only while bringing up a co-presence app-server. */
4
5
  export declare function createCodexCopresenceThread(ws: string, timeoutMs: number, resumeThreadId?: string, model?: string,
5
6
  /** forkFirst (board #738): `thread/fork` the recorded thread, then resume the NEW thread. */
@@ -73,7 +73,9 @@ export declare function exactSessionRows(rows: readonly {
73
73
  * process's /proc/<pid>/cmdline — only the config path does.
74
74
  */
75
75
  export declare function tokenInSessionSnippet(configPath: string, jsRuntime: string): string;
76
- export declare function appserverShellCommand(plan: ExternalAppserverPlan, jsRuntime: string): string;
76
+ /** Same token handoff, via the standalone binary's internal argv (it is not `node -e`). */
77
+ export declare function standaloneBinTokenSnippet(configPath: string, anetBin: string): string;
78
+ export declare function appserverShellCommand(plan: ExternalAppserverPlan, jsRuntime: string, mode?: "js-eval" | "standalone-bin"): string;
77
79
  /**
78
80
  * Board #734 — `codex --version` with the app-server pane's exact preamble (workspace
79
81
  * .env sourced the same way, same CODEX_HOME), run with `bash -c` like the pane, so the
@@ -2,11 +2,41 @@
2
2
  export declare function resolveDaemonProviderTarget(nodesDir: string, target: {
3
3
  node_id: string;
4
4
  alias: string;
5
- }, networkId: string): {
5
+ }, networkId: string, readOnly?: boolean): {
6
6
  dir: string;
7
7
  config: Record<string, any>;
8
8
  };
9
- export declare function scanDaemonCodex(nodesDir: string, targets: unknown, networkId: string, hostHome?: string): {
9
+ export declare function scanDaemonCodex(nodesDir: string, targets: unknown, networkId: string, hostHome?: string, discoverLocal?: boolean): {
10
+ observed_at: number;
11
+ scope: string;
12
+ rows: ({
13
+ status: string;
14
+ node_id: any;
15
+ alias: any;
16
+ } | {
17
+ node_configured_model: string | null;
18
+ config_revision: string | null;
19
+ config_status: string;
20
+ configured_provider: string | null;
21
+ configured_model: string | null;
22
+ provider_ids: string[];
23
+ auth_kind: string;
24
+ credential_status: string;
25
+ account_fingerprint: string | null;
26
+ verification: string;
27
+ effective_state: string;
28
+ status: string;
29
+ runtime: string | null;
30
+ home_ref: string;
31
+ home_source: string;
32
+ node_id: any;
33
+ alias: any;
34
+ })[];
35
+ } | {
36
+ local_discovery: {
37
+ status: string;
38
+ rows: any[];
39
+ };
10
40
  observed_at: number;
11
41
  scope: string;
12
42
  rows: ({
@@ -0,0 +1,28 @@
1
+ import { DaemonProviderStore } from './daemon-provider-store';
2
+ export declare function chatgptCredentialFingerprint(raw: string): string;
3
+ export declare class ProviderAccountCustody {
4
+ private nodeId;
5
+ private authPath;
6
+ private readAuth;
7
+ private previous?;
8
+ private selected?;
9
+ private before;
10
+ private next;
11
+ private installed;
12
+ private prepared;
13
+ constructor(store: DaemonProviderStore, nodeId: string, authPath: string, previousId: string | undefined, selectedId: string | undefined, readAuth: () => string | null);
14
+ get fingerprint(): string | undefined;
15
+ get previousFingerprint(): string | undefined;
16
+ get accountId(): string | undefined;
17
+ /** Capture AFTER verified stop: Codex may have refreshed auth since preflight. */
18
+ prepare(): {
19
+ previous_id: string | null;
20
+ selected_id: string | null;
21
+ before_auth: string | null;
22
+ };
23
+ private park;
24
+ install(): void;
25
+ /** No saved copy is used for an active account. Preserve refreshed credentials
26
+ * before restoring the old login, including a failed same-account model edit. */
27
+ rollback(): void;
28
+ }
@@ -0,0 +1,3 @@
1
+ /** Read only the exact owned node's loopback app-server. No logout/login or
2
+ * token refresh request, and no account details are returned to the Hub. */
3
+ export declare function verifyChatgptAppserver(endpoint: string, timeoutMs?: number, webSocketCtor?: any): Promise<void>;
@@ -2,6 +2,8 @@ import { DaemonProviderStore } from './daemon-provider-store';
2
2
  export declare function providerNodeRevision(nodeDir: string): string;
3
3
  export declare function readProviderNodeConfig(nodeDir: string): Record<string, any>;
4
4
  export declare function readProviderNodeToml(nodeDir: string): import("smol-toml").TomlTable;
5
+ /** Private, local configured credentials only. Never inherit the caller's env. */
6
+ export declare function readProviderNodeEnv(nodeDir: string): Record<string, string>;
5
7
  export type ProviderApplicationRequest = {
6
8
  requestId: string;
7
9
  networkId: string;
@@ -13,6 +15,7 @@ export type ProviderApplicationRequest = {
13
15
  providerId: string;
14
16
  authId: string;
15
17
  model: string;
18
+ accountId?: string;
16
19
  confirmRestart: true;
17
20
  };
18
21
  export type ProviderActivation = {
@@ -25,6 +28,7 @@ export type ProviderApplicationLifecycle = {
25
28
  preflight?: () => Promise<void>;
26
29
  stopVerified: () => Promise<void>;
27
30
  activate: (expected: ProviderActivation) => Promise<ProviderActivation>;
31
+ verifyChatgpt?: () => Promise<void>;
28
32
  restore: () => Promise<void>;
29
33
  };
30
34
  /** Stop → private writes → verified activation. A crash leaves an explicit
@@ -0,0 +1,29 @@
1
+ import { DaemonProviderStore } from './daemon-provider-store';
2
+ import { type ProviderCollection } from './shared/provider-collection';
3
+ export { validProviderCollection, type ProviderCollection } from './shared/provider-collection';
4
+ /** Hub transport must authorize/revalidate binding before invoking this local
5
+ * operation. Local CLI users explicitly select an owned registry identity. */
6
+ export declare function collectDaemonProvider(nodesDir: string, store: DaemonProviderStore, selection: ProviderCollection, revision: number, requestId?: string): {
7
+ revision: number;
8
+ source: "daemon";
9
+ providers: {
10
+ id: string;
11
+ label: string;
12
+ enabled: boolean;
13
+ runtimes: {
14
+ runtime: "codex-tui";
15
+ auth: {
16
+ credential_present: boolean;
17
+ verification: "not_checked";
18
+ application: "not_applied";
19
+ account_id?: string | undefined;
20
+ baseUrl?: string | undefined;
21
+ id: string;
22
+ kind: import("./daemon-provider-store").ProviderAuthKind;
23
+ models: string[];
24
+ }[];
25
+ }[];
26
+ }[];
27
+ network_id: string;
28
+ daemon_node_id: string;
29
+ };
@@ -1,4 +1,4 @@
1
- export declare const DAEMON_PROVIDER_USAGE = "anet daemon provider <list|scan|put|apply> <daemon> [--revision N] [--request dps_UUID] (put/scan/apply read private JSON from stdin; no key in argv)";
1
+ export declare const DAEMON_PROVIDER_USAGE = "anet daemon provider <list|scan|put|collect|apply|initialize> <daemon> [--revision N] [--request dps_UUID] (put/collect/scan/apply/initialize read private JSON from stdin; no key in argv)";
2
2
  export declare function readProviderInput(fd?: number): string;
3
3
  export declare function runDaemonProvider(args: string[], deps: {
4
4
  nodesDir: string;
@@ -0,0 +1,27 @@
1
+ import { DaemonProviderStore } from './daemon-provider-store';
2
+ import { type ProviderInitialization } from './shared/provider-initialization';
3
+ type Request = {
4
+ request_id: string;
5
+ alias: string;
6
+ network_id: string;
7
+ daemon_node_id: string;
8
+ selection: ProviderInitialization;
9
+ };
10
+ export declare function initializeDaemonProvider(nodesDir: string, store: DaemonProviderStore, request: Request): Promise<{
11
+ status: string;
12
+ request_id: string;
13
+ node_id: string;
14
+ provider_revision: number;
15
+ provider_id: string;
16
+ auth_id: string;
17
+ model: string;
18
+ runtime_provider: string;
19
+ node_revision: string;
20
+ verification: string;
21
+ }>;
22
+ export declare function runDaemonProviderInitialize(args: string[], deps: {
23
+ nodesDir: string;
24
+ readInput: () => string;
25
+ print: (text: string) => void;
26
+ }): Promise<number>;
27
+ export {};
@@ -1,8 +1,21 @@
1
1
  export type ProviderAuthKind = "chatgpt" | "api_key";
2
+ export type ApplicationProfile = {
3
+ providerId: string;
4
+ authId: string;
5
+ model: string;
6
+ } & ({
7
+ kind: 'api_key';
8
+ baseUrl: string;
9
+ key: string;
10
+ } | {
11
+ kind: 'chatgpt';
12
+ accountId: string;
13
+ });
2
14
  export declare class DaemonProviderError extends Error {
3
15
  readonly code: string;
4
16
  constructor(code: string);
5
17
  }
18
+ export declare function readPrivateJson(path: string): unknown;
6
19
  export declare class DaemonProviderStore {
7
20
  private readonly root;
8
21
  private readonly scope;
@@ -23,6 +36,7 @@ export declare class DaemonProviderStore {
23
36
  credential_present: boolean;
24
37
  verification: "not_checked";
25
38
  application: "not_applied";
39
+ account_id?: string | undefined;
26
40
  baseUrl?: string | undefined;
27
41
  id: string;
28
42
  kind: ProviderAuthKind;
@@ -33,6 +47,17 @@ export declare class DaemonProviderStore {
33
47
  network_id: string;
34
48
  daemon_node_id: string;
35
49
  };
50
+ /** Presence only, never entitlement. Resolve an opaque saved-login ID solely
51
+ * inside this daemon's owned directory; callers cannot supply a credential path. */
52
+ private savedAccountPresent;
53
+ /** Local-only resolver. Never serialize this credential directory into a receipt. */
54
+ savedAccountHome(id: string): string | null;
55
+ /** Internal daemon bootstrap; this private path must never enter Hub replies. */
56
+ prepareLoginDirectory(): {
57
+ root: string;
58
+ network_id: string;
59
+ daemon_node_id: string;
60
+ };
36
61
  /** Local application lease. Secrets stay inside the daemon callback, never in list/scan. */
37
62
  withApiKey<T>(selection: {
38
63
  revision: number;
@@ -46,6 +71,12 @@ export declare class DaemonProviderStore {
46
71
  baseUrl: string;
47
72
  key: string;
48
73
  }) => Promise<T>): Promise<T>;
74
+ withApplicationProfile<T>(selection: {
75
+ revision: number;
76
+ providerId: string;
77
+ authId: string;
78
+ model: string;
79
+ }, apply: (profile: ApplicationProfile) => Promise<T>): Promise<T>;
49
80
  upsert(value: unknown, expectedRevision: number, requestId?: string): {
50
81
  revision: number;
51
82
  source: "daemon";
@@ -59,6 +90,7 @@ export declare class DaemonProviderStore {
59
90
  credential_present: boolean;
60
91
  verification: "not_checked";
61
92
  application: "not_applied";
93
+ account_id?: string | undefined;
62
94
  baseUrl?: string | undefined;
63
95
  id: string;
64
96
  kind: ProviderAuthKind;