@sleep2agi/agent-network 2.3.0-preview.141 → 2.3.0-preview.143
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/cli.js +2 -2
- package/dist/src/client.js +1 -1
- package/dist/src/codex-menu.d.ts +21 -0
- package/dist/src/node-ls-all.d.ts +80 -0
- package/dist/src/node-menu.d.ts +40 -0
- package/dist/src/node-server.js +8 -8
- package/dist/src/opencode-agent-node-pair.d.ts +6 -6
- package/package.json +1 -1
package/dist/src/client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a0_0x26dbc9=a0_0xe7e2;(function(_0x1ae6c2,_0x907afb){const _0x1a0ecd=a0_0xe7e2,_0x15ad19=_0x1ae6c2();while(!![]){try{const _0x10bb00=parseInt(_0x1a0ecd(0x1ad))/0x1+-parseInt(_0x1a0ecd(0x1b1))/0x2+parseInt(_0x1a0ecd(0x157))/0x3*(-parseInt(_0x1a0ecd(0x15d))/0x4)+-parseInt(_0x1a0ecd(0x162))/0x5*(-parseInt(_0x1a0ecd(0x1a7))/0x6)+-parseInt(_0x1a0ecd(0x183))/0x7+-parseInt(_0x1a0ecd(0x169))/0x8*(-parseInt(_0x1a0ecd(0x173))/0x9)+parseInt(_0x1a0ecd(0x1a2))/0xa;if(_0x10bb00===_0x907afb)break;else _0x15ad19['push'](_0x15ad19['shift']());}catch(_0xa8c021){_0x15ad19['push'](_0x15ad19['shift']());}}}(a0_0x22de,0x50c44));import{EventEmitter as a0_0x2109ca}from'events';import{hostname as a0_0x483dac}from'os';var K=/(?:atok|ntok|utok|ghp|github_pat)_[A-Za-z0-9_-]+|Bearer\s+\S+/gi,L=(_0x4376e3,_0x4a0b40)=>(_0x4376e3??_0x4a0b40)[a0_0x26dbc9(0x19a)](/[\r\n\x00-\x1f\x7f]/g,'\x20')[a0_0x26dbc9(0x179)](0x0,0xf0);function N(_0x1b3b19){const _0x591008=a0_0x26dbc9;return(_0x1b3b19 instanceof Error?_0x1b3b19[_0x591008(0x146)]:String(_0x1b3b19??_0x591008(0x18d)))[_0x591008(0x19a)](K,_0x591008(0x15b))[_0x591008(0x19a)](/[\r\n\x00-\x1f\x7f]/g,'\x20')[_0x591008(0x179)](0x0,0xf0);}function O(_0x7a2e00,_0x55300a=process.env.ANET_TASK_TRACE_FORMAT===a0_0x26dbc9(0x15e)){const _0x10a5e3=a0_0x26dbc9;if(_0x55300a)return JSON[_0x10a5e3(0x181)](_0x7a2e00);let _0x2ad68c=L(_0x7a2e00[_0x10a5e3(0x15f)],'<missing>'),_0x55f87b=L(_0x7a2e00['task_id'],_0x10a5e3(0x184)),_0x40a04f=_0x7a2e00[_0x10a5e3(0x1aa)]?_0x10a5e3(0x199)+_0x7a2e00[_0x10a5e3(0x1aa)]+':'+(_0x7a2e00[_0x10a5e3(0x1af)]??''):'';return'[commhub:task]\x20'+_0x7a2e00[_0x10a5e3(0x151)]+_0x10a5e3(0x175)+L(_0x7a2e00[_0x10a5e3(0x188)],_0x10a5e3(0x14c))+_0x10a5e3(0x143)+L(_0x7a2e00[_0x10a5e3(0x14e)],_0x10a5e3(0x14c))+_0x10a5e3(0x18a)+_0x55f87b+_0x10a5e3(0x168)+_0x2ad68c+'\x20network_id='+L(_0x7a2e00[_0x10a5e3(0x142)],_0x10a5e3(0x14c))+_0x10a5e3(0x17b)+_0x7a2e00['transport']+_0x10a5e3(0x148)+_0x7a2e00['duration_ms']+_0x10a5e3(0x177)+_0x7a2e00[_0x10a5e3(0x171)]+_0x40a04f;}function U(_0x56a9b1){const _0x205956=a0_0x26dbc9;return{'event':{'sending':'task.send.start','delivered':'task.send.delivered','failed':_0x205956(0x161),'acked':_0x205956(0x1a0),'started':_0x205956(0x16a),'replied':_0x205956(0x17d),'expired':'task.expired'}[_0x56a9b1[_0x205956(0x151)]],..._0x56a9b1};}function a0_0xe7e2(_0x321c85,_0xc02cc){_0x321c85=_0x321c85-0x13c;const _0x22debb=a0_0x22de();let _0xe7e268=_0x22debb[_0x321c85];return _0xe7e268;}function a0_0x22de(){const _0x9306b5=['report_status','messages','network_id','\x20to=','Bearer\x20','sleep','message','resumeId','\x20duration_ms=','transport','content','idle','<unknown>','POST','to_alias','delivered','match','status','send',']\x20[commhub:','application/json,\x20text/event-stream','from_session','send_reply','543kehgnL','send_message','url','getReader','[REDACTED]','read','11240doTLfl','json','parent_task_id','disconnect','task.send.failed','30zswahA','reconnectDelay','server','send_task','connectSSE','error','\x20parent_task_id=','5160VYJiwg','task.started','min','pop','getAllStatus','type','cwd','networkId','lifecycle_tracking','new_message','6705mpjeTf','SSE\x20failed:\x20','\x20from=','split','\x20lifecycle=','broadcast','slice','sending','\x20transport=','heartbeatInterval','task.replied','processInbox','sseAbort','now','stringify','catch','3280144UMlZoU','<pending>','heartbeatTimer','body','token','from_alias','log','\x20task_id=','autoConnect','failed','unknown\x20error','message_id','text/event-stream','agent','fromAlias','CommHub\x20rejected\x20task','task','registered','inbox\x20error:\x20','tools/call','CommHub\x20response\x20omitted\x20task_id','s...','\x20error=','replace','text','/mcp','parse','alias','running','task.ack','/events/','4527910ulBbfi','parentTaskId','heartbeat\x20failed:\x20','not_tracked','disconnected','120546jGSYWg','toTimeString','task_id','error_code','SSE\x20connected','completed','392365medzdL','name','error_message','SSE\x20reconnecting\x20in\x20','276410LAEabL','send_failed','emit','Authorization','AbortError','call','connect','SSE\x20error:\x20','toString'];a0_0x22de=function(){return _0x9306b5;};return a0_0x22de();}function j(_0x194d61){const _0x43c526=a0_0x26dbc9;let _0x5aec79=_0x194d61?.[_0x43c526(0x1a9)]||_0x194d61?.[_0x43c526(0x18e)]||_0x194d61?.['id'];if(_0x5aec79)return String(_0x5aec79);let _0x857678=_0x194d61?.[_0x43c526(0x14a)]?.[0x0]?.[_0x43c526(0x19b)];if(typeof _0x857678!=='string')return null;try{let _0x2ff496=JSON[_0x43c526(0x19d)](_0x857678);return _0x2ff496?.[_0x43c526(0x1a9)]||_0x2ff496?.[_0x43c526(0x18e)]||_0x2ff496?.['id']||null;}catch{return null;}}async function X(_0x13d82d,_0x19178a){const _0x336a76=a0_0x26dbc9;let _0x4841bd=_0x19178a[_0x336a76(0x180)]??Date['now'],_0x2b9e12=_0x4841bd(),_0x163d09=(_0x48017c,_0x5090e0,_0x4da7bf,_0x4924c4)=>{const _0x594685=_0x336a76;_0x19178a[_0x594685(0x189)](O(U({'from_alias':_0x13d82d[_0x594685(0x191)],'to_alias':_0x13d82d['toAlias'],'task_id':_0x5090e0,'parent_task_id':_0x13d82d[_0x594685(0x1a3)],'network_id':_0x13d82d[_0x594685(0x170)],'transport':_0x13d82d[_0x594685(0x149)],'status':_0x48017c,'duration_ms':_0x4841bd()-_0x2b9e12,'lifecycle_tracking':_0x13d82d['lifecycleTracking'],..._0x4da7bf!==void 0x0?{'error_code':_0x4924c4||'send_failed','error_message':N(_0x4da7bf)}:{}})));};_0x163d09(_0x336a76(0x17a),null);try{let _0x436ba6=await _0x19178a[_0x336a76(0x152)](),_0x287f4f=j(_0x436ba6);if(_0x287f4f)_0x163d09(_0x336a76(0x14f),_0x287f4f);else{if(_0x436ba6?.['ok']===!0x1||_0x436ba6?.[_0x336a76(0x167)])_0x163d09(_0x336a76(0x18c),_0x287f4f,_0x436ba6?.['error']||_0x336a76(0x192),'send_rejected');else _0x163d09(_0x336a76(0x18c),null,_0x336a76(0x197),'missing_task_id');}return _0x436ba6;}catch(_0x4f5fdc){throw _0x163d09('failed',null,_0x4f5fdc,_0x336a76(0x1b2)),_0x4f5fdc;}}async function Y(_0x3bef1d,_0x5e23d3){const _0x55c0ce=a0_0x26dbc9;return X({'fromAlias':_0x3bef1d[_0x55c0ce(0x191)],'toAlias':_0x3bef1d[_0x55c0ce(0x19e)],'parentTaskId':_0x3bef1d[_0x55c0ce(0x1a3)]||null,'networkId':_0x3bef1d[_0x55c0ce(0x170)]||null,'transport':'mcp_http','lifecycleTracking':_0x55c0ce(0x1a5)},_0x5e23d3);}class $ extends a0_0x2109ca{[a0_0x26dbc9(0x159)];[a0_0x26dbc9(0x19e)];[a0_0x26dbc9(0x187)];['agent'];[a0_0x26dbc9(0x147)];[a0_0x26dbc9(0x17c)];[a0_0x26dbc9(0x163)];[a0_0x26dbc9(0x185)];[a0_0x26dbc9(0x17f)];[a0_0x26dbc9(0x19f)]=!0x1;constructor(_0x18987f){const _0x4e7fbc=a0_0x26dbc9;super();if(this[_0x4e7fbc(0x159)]=_0x18987f[_0x4e7fbc(0x159)][_0x4e7fbc(0x19a)](/\/$/,''),this[_0x4e7fbc(0x19e)]=_0x18987f[_0x4e7fbc(0x19e)],this['token']=_0x18987f[_0x4e7fbc(0x187)],this[_0x4e7fbc(0x190)]=_0x18987f[_0x4e7fbc(0x190)]||'sdk',this[_0x4e7fbc(0x147)]='sdk-'+_0x18987f['alias']+'-'+Date[_0x4e7fbc(0x180)]()[_0x4e7fbc(0x13f)](0x24),this[_0x4e7fbc(0x17c)]=_0x18987f[_0x4e7fbc(0x17c)]??0x2bf20,this[_0x4e7fbc(0x163)]=_0x18987f[_0x4e7fbc(0x163)]??0xbb8,_0x18987f[_0x4e7fbc(0x18b)]!==!0x1)this[_0x4e7fbc(0x13d)]();}[a0_0x26dbc9(0x189)](_0x13f39f){const _0x3352e0=a0_0x26dbc9;console[_0x3352e0(0x189)]('['+new Date()[_0x3352e0(0x1a8)]()[_0x3352e0(0x179)](0x0,0x8)+_0x3352e0(0x153)+this[_0x3352e0(0x19e)]+']\x20'+_0x13f39f);}async['call'](_0xb5f92d,_0x549a28){const _0x191931=a0_0x26dbc9;let _0x3dae98={'Content-Type':'application/json','Accept':_0x191931(0x154)};if(this[_0x191931(0x187)])_0x3dae98[_0x191931(0x1b4)]=_0x191931(0x144)+this[_0x191931(0x187)];let _0x211c4b=await(await fetch(this[_0x191931(0x159)]+_0x191931(0x19c),{'method':_0x191931(0x14d),'headers':_0x3dae98,'body':JSON[_0x191931(0x181)]({'jsonrpc':'2.0','id':Date[_0x191931(0x180)](),'method':_0x191931(0x196),'params':{'name':_0xb5f92d,'arguments':_0x549a28}})}))[_0x191931(0x19b)](),_0x3352f8=_0x211c4b[_0x191931(0x150)](/data: (.+)/),_0x25a00d=_0x3352f8?JSON[_0x191931(0x19d)](_0x3352f8[0x1]):JSON[_0x191931(0x19d)](_0x211c4b),_0x4e2c81=_0x25a00d?.['result']?.[_0x191931(0x14a)]?.[0x0]?.[_0x191931(0x19b)];return _0x4e2c81?JSON[_0x191931(0x19d)](_0x4e2c81):_0x25a00d;}async[a0_0x26dbc9(0x13d)](){const _0x14773e=a0_0x26dbc9;if(this[_0x14773e(0x19f)])return;this[_0x14773e(0x19f)]=!0x0,await this[_0x14773e(0x151)](_0x14773e(0x14b)),this[_0x14773e(0x189)](_0x14773e(0x194)),this['heartbeatTimer']=setInterval(()=>{const _0x421c0c=_0x14773e;this[_0x421c0c(0x151)](_0x421c0c(0x14b))[_0x421c0c(0x182)](_0x239177=>this['log'](_0x421c0c(0x1a4)+_0x239177[_0x421c0c(0x146)]));},this['heartbeatInterval']),this[_0x14773e(0x166)]();}async[a0_0x26dbc9(0x160)](){const _0x53f16e=a0_0x26dbc9;if(this[_0x53f16e(0x19f)]=!0x1,this['sseAbort']?.['abort'](),this[_0x53f16e(0x185)])clearInterval(this[_0x53f16e(0x185)]);await this['status']('offline')['catch'](()=>{}),this[_0x53f16e(0x189)](_0x53f16e(0x1a6));}async[a0_0x26dbc9(0x152)](_0x4e6047,_0x418e1f,_0x39993b='normal'){const _0x35e1df=a0_0x26dbc9;return Y({'alias':_0x4e6047,'fromAlias':this[_0x35e1df(0x19e)]},{'log':_0x3227e4=>console[_0x35e1df(0x189)](_0x3227e4),'send':()=>this[_0x35e1df(0x13c)](_0x35e1df(0x165),{'alias':_0x4e6047,'task':_0x418e1f,'priority':_0x39993b,'from_session':this[_0x35e1df(0x19e)]})});}async[a0_0x26dbc9(0x146)](_0x1992ec,_0x30ad63){const _0x4e2bda=a0_0x26dbc9;return this['call'](_0x4e2bda(0x158),{'alias':_0x1992ec,'message':_0x30ad63,'from_session':this[_0x4e2bda(0x19e)]});}async['reply'](_0x2337dc,_0x4a0cae,_0x1832f7=a0_0x26dbc9(0x1ac)){const _0x204b67=a0_0x26dbc9;return this[_0x204b67(0x13c)](_0x204b67(0x156),{'in_reply_to':_0x2337dc,'text':_0x4a0cae,'status':_0x1832f7});}async[a0_0x26dbc9(0x151)](_0x12757f,_0x1047c6){const _0x13d2be=a0_0x26dbc9;return this[_0x13d2be(0x13c)](_0x13d2be(0x140),{'resume_id':this[_0x13d2be(0x147)],'alias':this['alias'],'status':_0x12757f,'server':a0_0x483dac(),'hostname':a0_0x483dac(),'agent':this[_0x13d2be(0x190)],'project_dir':process[_0x13d2be(0x16f)](),..._0x1047c6});}async[a0_0x26dbc9(0x16d)](){const _0x3ce723=a0_0x26dbc9;return this[_0x3ce723(0x13c)]('get_all_status',{});}async[a0_0x26dbc9(0x178)](_0x48db6d,_0x52d47e){const _0x36fc4f=a0_0x26dbc9;return this[_0x36fc4f(0x13c)](_0x36fc4f(0x178),{'message':_0x48db6d,'filter_server':_0x52d47e?.[_0x36fc4f(0x164)],'filter_status':_0x52d47e?.[_0x36fc4f(0x151)]});}async[a0_0x26dbc9(0x166)](){const _0x18bba9=a0_0x26dbc9;let _0x6f9759=encodeURIComponent(this[_0x18bba9(0x19e)]),_0x5988a2=this['url']+_0x18bba9(0x1a1)+_0x6f9759,_0x486212=this['reconnectDelay'];while(this['running']){try{this[_0x18bba9(0x17f)]=new AbortController();let _0x14df06={'Accept':_0x18bba9(0x18f)};if(this[_0x18bba9(0x187)])_0x14df06['Authorization']=_0x18bba9(0x144)+this[_0x18bba9(0x187)];let _0x41a1c5=await fetch(_0x5988a2,{'headers':_0x14df06,'signal':this[_0x18bba9(0x17f)]['signal']});if(!_0x41a1c5['ok']||!_0x41a1c5[_0x18bba9(0x186)]){this[_0x18bba9(0x189)](_0x18bba9(0x174)+_0x41a1c5[_0x18bba9(0x151)]),await this[_0x18bba9(0x145)](_0x486212),_0x486212=Math[_0x18bba9(0x16b)](_0x486212*1.5,0xea60);continue;}_0x486212=this[_0x18bba9(0x163)];let _0x19738e=_0x41a1c5[_0x18bba9(0x186)][_0x18bba9(0x15a)](),_0x34d658=new TextDecoder(),_0x5b3a14='';while(this[_0x18bba9(0x19f)]){let {done:_0x4f0596,value:_0x188126}=await _0x19738e[_0x18bba9(0x15c)]();if(_0x4f0596)break;_0x5b3a14+=_0x34d658['decode'](_0x188126,{'stream':!0x0});let _0x4d8da4=_0x5b3a14[_0x18bba9(0x176)]('\x0a');_0x5b3a14=_0x4d8da4[_0x18bba9(0x16c)]()||'';for(let _0x3f70f3 of _0x4d8da4){if(!_0x3f70f3['startsWith']('data:\x20'))continue;try{let _0x42c4c1=JSON['parse'](_0x3f70f3[_0x18bba9(0x179)](0x6));if(_0x42c4c1['type']==='connected'){this[_0x18bba9(0x189)](_0x18bba9(0x1ab)),this[_0x18bba9(0x1b3)]('connected');continue;}if(_0x42c4c1['type']==='new_task'||_0x42c4c1[_0x18bba9(0x16e)]===_0x18bba9(0x172)||_0x42c4c1[_0x18bba9(0x16e)]===_0x18bba9(0x178))await this[_0x18bba9(0x17e)]();}catch{}}}}catch(_0x468e5c){if(_0x468e5c[_0x18bba9(0x1ae)]===_0x18bba9(0x1b5))break;this[_0x18bba9(0x1b3)](_0x18bba9(0x167),_0x468e5c),this['log'](_0x18bba9(0x13e)+_0x468e5c[_0x18bba9(0x146)]);}if(this[_0x18bba9(0x19f)])this['emit'](_0x18bba9(0x1a6)),this[_0x18bba9(0x189)](_0x18bba9(0x1b0)+_0x486212/0x3e8+_0x18bba9(0x198)),await this[_0x18bba9(0x145)](_0x486212),_0x486212=Math[_0x18bba9(0x16b)](_0x486212*1.5,0xea60);}}async[a0_0x26dbc9(0x17e)](){const _0x4614d1=a0_0x26dbc9;try{let _0x4e903d=(await this['call']('get_inbox',{'alias':this[_0x4614d1(0x19e)],'limit':0xa}))?.[_0x4614d1(0x141)]||[];for(let _0x169d95 of _0x4e903d)await this['call']('ack_inbox',{'alias':this[_0x4614d1(0x19e)],'message_id':_0x169d95['id']}),this[_0x4614d1(0x189)]('←\x20'+_0x169d95[_0x4614d1(0x155)]+':\x20'+_0x169d95[_0x4614d1(0x14a)][_0x4614d1(0x179)](0x0,0x3c)),this[_0x4614d1(0x1b3)](_0x4614d1(0x193),_0x169d95),this[_0x4614d1(0x1b3)](_0x4614d1(0x146),_0x169d95);}catch(_0x3d7813){this['log'](_0x4614d1(0x195)+_0x3d7813[_0x4614d1(0x146)]);}}[a0_0x26dbc9(0x145)](_0x58099b){return new Promise(_0x2530bf=>setTimeout(_0x2530bf,_0x58099b));}}var F=$;export{F as default,$ as CommHub};
|
|
1
|
+
const a0_0x534c7b=a0_0x47bc;(function(_0x7fa15b,_0x52b52b){const _0x1ba2bf=a0_0x47bc,_0x46fba5=_0x7fa15b();while(!![]){try{const _0x3529a6=-parseInt(_0x1ba2bf(0xd7))/0x1+-parseInt(_0x1ba2bf(0xde))/0x2+parseInt(_0x1ba2bf(0x9d))/0x3*(parseInt(_0x1ba2bf(0x97))/0x4)+-parseInt(_0x1ba2bf(0x7e))/0x5+parseInt(_0x1ba2bf(0xa7))/0x6*(parseInt(_0x1ba2bf(0xd5))/0x7)+parseInt(_0x1ba2bf(0xdb))/0x8+parseInt(_0x1ba2bf(0x7c))/0x9*(parseInt(_0x1ba2bf(0xc3))/0xa);if(_0x3529a6===_0x52b52b)break;else _0x46fba5['push'](_0x46fba5['shift']());}catch(_0x28bab1){_0x46fba5['push'](_0x46fba5['shift']());}}}(a0_0x59c9,0xd08ec));import{EventEmitter as a0_0x1281ff}from'events';import{hostname as a0_0x129268}from'os';var K=/(?:atok|ntok|utok|ghp|github_pat)_[A-Za-z0-9_-]+|Bearer\s+\S+/gi,L=(_0x1ea1be,_0xe1524a)=>(_0x1ea1be??_0xe1524a)[a0_0x534c7b(0xe9)](/[\r\n\x00-\x1f\x7f]/g,'\x20')['slice'](0x0,0xf0);function N(_0x5d74a4){const _0x1d9bc9=a0_0x534c7b;return(_0x5d74a4 instanceof Error?_0x5d74a4['message']:String(_0x5d74a4??_0x1d9bc9(0xca)))['replace'](K,_0x1d9bc9(0xaf))[_0x1d9bc9(0xe9)](/[\r\n\x00-\x1f\x7f]/g,'\x20')['slice'](0x0,0xf0);}function a0_0x47bc(_0x44be75,_0x2a9af5){_0x44be75=_0x44be75-0x65;const _0x59c97a=a0_0x59c9();let _0x47bca8=_0x59c97a[_0x44be75];return _0x47bca8;}function O(_0x5e1b40,_0x1ca9d3=process.env.ANET_TASK_TRACE_FORMAT===a0_0x534c7b(0xa3)){const _0x488277=a0_0x534c7b;if(_0x1ca9d3)return JSON[_0x488277(0xb8)](_0x5e1b40);let _0x5094b3=L(_0x5e1b40[_0x488277(0x8d)],'<missing>'),_0x591f17=L(_0x5e1b40[_0x488277(0x73)],_0x488277(0x81)),_0x36d2a0=_0x5e1b40['error_code']?_0x488277(0x8b)+_0x5e1b40[_0x488277(0xad)]+':'+(_0x5e1b40[_0x488277(0xe4)]??''):'';return'[commhub:task]\x20'+_0x5e1b40['status']+_0x488277(0xb3)+L(_0x5e1b40[_0x488277(0xc8)],_0x488277(0x94))+_0x488277(0xdc)+L(_0x5e1b40[_0x488277(0xec)],'<unknown>')+_0x488277(0xbf)+_0x591f17+_0x488277(0xe0)+_0x5094b3+_0x488277(0xa4)+L(_0x5e1b40[_0x488277(0x76)],_0x488277(0x94))+_0x488277(0x6f)+_0x5e1b40[_0x488277(0x92)]+_0x488277(0x89)+_0x5e1b40[_0x488277(0xc0)]+'\x20lifecycle='+_0x5e1b40[_0x488277(0x7f)]+_0x36d2a0;}function U(_0x15514f){const _0x109cd2=a0_0x534c7b;return{'event':{'sending':_0x109cd2(0xc4),'delivered':_0x109cd2(0x65),'failed':'task.send.failed','acked':_0x109cd2(0x87),'started':_0x109cd2(0x70),'replied':_0x109cd2(0xb7),'expired':_0x109cd2(0xb5)}[_0x15514f[_0x109cd2(0xb6)]],..._0x15514f};}function a0_0x59c9(){const _0x5b458a=['message_id','3MyZXYw','match','type','inbox\x20error:\x20','string','connectSSE','json','\x20network_id=','alias','content','276kbeImw','error','reconnectDelay','AbortError','name','failed','error_code','heartbeatTimer','[REDACTED]','getReader','autoConnect','parse','\x20from=','server','task.expired','status','task.replied','stringify','report_status','connected','lifecycleTracking','sdk','missing_task_id','task','\x20task_id=','duration_ms','SSE\x20connected','POST','285410qCjCBP','task.send.start','SSE\x20error:\x20','emit','connect','from_alias','reply','unknown\x20error','text','sseAbort','now','startsWith','resumeId','call','send_reply',']\x20[commhub:','sleep','url','15260FrPXmN','abort','537703vjtoHq','text/event-stream','toAlias','getAllStatus','10136248lCDakz','\x20to=','fromAlias','2352552sRrUvh','parentTaskId','\x20parent_task_id=','2.0','min','signal','error_message','data:\x20','from_session','running','token','replace','split','sending','to_alias','catch','heartbeat\x20failed:\x20','task.send.delivered','delivered','send_message','pop','tools/call','SSE\x20reconnecting\x20in\x20','messages','Bearer\x20','/events/','completed','\x20transport=','task.started','normal','body','task_id','read','offline','network_id','result','s...','disconnected','processInbox','send_task','108BHumEV','get_inbox','1334575DJwqbV','lifecycle_tracking','application/json','<pending>','log','cwd','slice','CommHub\x20response\x20omitted\x20task_id','send_failed','task.ack','networkId','\x20duration_ms=','registered','\x20error=','toTimeString','parent_task_id','toString','agent','message','send_rejected','transport','Authorization','<unknown>','sdk-','broadcast','4501372VSPkHP','application/json,\x20text/event-stream','heartbeatInterval','mcp_http','send'];a0_0x59c9=function(){return _0x5b458a;};return a0_0x59c9();}function j(_0x399b12){const _0x160613=a0_0x534c7b;let _0x31323e=_0x399b12?.['task_id']||_0x399b12?.[_0x160613(0x9c)]||_0x399b12?.['id'];if(_0x31323e)return String(_0x31323e);let _0x11defa=_0x399b12?.[_0x160613(0xa6)]?.[0x0]?.[_0x160613(0xcb)];if(typeof _0x11defa!==_0x160613(0xa1))return null;try{let _0x276d1f=JSON['parse'](_0x11defa);return _0x276d1f?.[_0x160613(0x73)]||_0x276d1f?.['message_id']||_0x276d1f?.['id']||null;}catch{return null;}}async function X(_0x2d6689,_0x234150){const _0x23042f=a0_0x534c7b;let _0x4616b1=_0x234150[_0x23042f(0xcd)]??Date[_0x23042f(0xcd)],_0x367f44=_0x4616b1(),_0x2ae182=(_0xa22398,_0x9c00d7,_0x3ee450,_0x186be5)=>{const _0x164d8e=_0x23042f;_0x234150[_0x164d8e(0x82)](O(U({'from_alias':_0x2d6689[_0x164d8e(0xdd)],'to_alias':_0x2d6689[_0x164d8e(0xd9)],'task_id':_0x9c00d7,'parent_task_id':_0x2d6689[_0x164d8e(0xdf)],'network_id':_0x2d6689[_0x164d8e(0x88)],'transport':_0x2d6689[_0x164d8e(0x92)],'status':_0xa22398,'duration_ms':_0x4616b1()-_0x367f44,'lifecycle_tracking':_0x2d6689[_0x164d8e(0xbb)],..._0x3ee450!==void 0x0?{'error_code':_0x186be5||'send_failed','error_message':N(_0x3ee450)}:{}})));};_0x2ae182(_0x23042f(0xeb),null);try{let _0x2710fc=await _0x234150[_0x23042f(0x9b)](),_0x11f14f=j(_0x2710fc);if(_0x11f14f)_0x2ae182(_0x23042f(0x66),_0x11f14f);else{if(_0x2710fc?.['ok']===!0x1||_0x2710fc?.[_0x23042f(0xa8)])_0x2ae182(_0x23042f(0xac),_0x11f14f,_0x2710fc?.[_0x23042f(0xa8)]||'CommHub\x20rejected\x20task',_0x23042f(0x91));else _0x2ae182(_0x23042f(0xac),null,_0x23042f(0x85),_0x23042f(0xbd));}return _0x2710fc;}catch(_0x151c02){throw _0x2ae182('failed',null,_0x151c02,_0x23042f(0x86)),_0x151c02;}}async function Y(_0x47ac8a,_0x28793b){const _0x38722a=a0_0x534c7b;return X({'fromAlias':_0x47ac8a[_0x38722a(0xdd)],'toAlias':_0x47ac8a[_0x38722a(0xa5)],'parentTaskId':_0x47ac8a[_0x38722a(0xdf)]||null,'networkId':_0x47ac8a['networkId']||null,'transport':_0x38722a(0x9a),'lifecycleTracking':'not_tracked'},_0x28793b);}class $ extends a0_0x1281ff{['url'];[a0_0x534c7b(0xa5)];['token'];[a0_0x534c7b(0x8f)];[a0_0x534c7b(0xcf)];[a0_0x534c7b(0x99)];['reconnectDelay'];[a0_0x534c7b(0xae)];[a0_0x534c7b(0xcc)];['running']=!0x1;constructor(_0xff663e){const _0x5e4777=a0_0x534c7b;super();if(this[_0x5e4777(0xd4)]=_0xff663e['url'][_0x5e4777(0xe9)](/\/$/,''),this['alias']=_0xff663e[_0x5e4777(0xa5)],this[_0x5e4777(0xe8)]=_0xff663e['token'],this[_0x5e4777(0x8f)]=_0xff663e[_0x5e4777(0x8f)]||_0x5e4777(0xbc),this[_0x5e4777(0xcf)]=_0x5e4777(0x95)+_0xff663e[_0x5e4777(0xa5)]+'-'+Date[_0x5e4777(0xcd)]()[_0x5e4777(0x8e)](0x24),this[_0x5e4777(0x99)]=_0xff663e[_0x5e4777(0x99)]??0x2bf20,this['reconnectDelay']=_0xff663e[_0x5e4777(0xa9)]??0xbb8,_0xff663e[_0x5e4777(0xb1)]!==!0x1)this[_0x5e4777(0xc7)]();}[a0_0x534c7b(0x82)](_0x559aa4){const _0x5a037f=a0_0x534c7b;console[_0x5a037f(0x82)]('['+new Date()[_0x5a037f(0x8c)]()[_0x5a037f(0x84)](0x0,0x8)+_0x5a037f(0xd2)+this[_0x5a037f(0xa5)]+']\x20'+_0x559aa4);}async[a0_0x534c7b(0xd0)](_0x51f861,_0x491367){const _0x4794f4=a0_0x534c7b;let _0x4598d={'Content-Type':_0x4794f4(0x80),'Accept':_0x4794f4(0x98)};if(this[_0x4794f4(0xe8)])_0x4598d[_0x4794f4(0x93)]=_0x4794f4(0x6c)+this[_0x4794f4(0xe8)];let _0x50b22e=await(await fetch(this[_0x4794f4(0xd4)]+'/mcp',{'method':_0x4794f4(0xc2),'headers':_0x4598d,'body':JSON[_0x4794f4(0xb8)]({'jsonrpc':_0x4794f4(0xe1),'id':Date[_0x4794f4(0xcd)](),'method':_0x4794f4(0x69),'params':{'name':_0x51f861,'arguments':_0x491367}})}))[_0x4794f4(0xcb)](),_0x492d95=_0x50b22e[_0x4794f4(0x9e)](/data: (.+)/),_0x23dc66=_0x492d95?JSON[_0x4794f4(0xb2)](_0x492d95[0x1]):JSON[_0x4794f4(0xb2)](_0x50b22e),_0x337c37=_0x23dc66?.[_0x4794f4(0x77)]?.[_0x4794f4(0xa6)]?.[0x0]?.['text'];return _0x337c37?JSON['parse'](_0x337c37):_0x23dc66;}async[a0_0x534c7b(0xc7)](){const _0x1c72bf=a0_0x534c7b;if(this[_0x1c72bf(0xe7)])return;this[_0x1c72bf(0xe7)]=!0x0,await this[_0x1c72bf(0xb6)]('idle'),this[_0x1c72bf(0x82)](_0x1c72bf(0x8a)),this['heartbeatTimer']=setInterval(()=>{const _0x2e8048=_0x1c72bf;this['status']('idle')[_0x2e8048(0xed)](_0x53d31d=>this[_0x2e8048(0x82)](_0x2e8048(0xee)+_0x53d31d[_0x2e8048(0x90)]));},this[_0x1c72bf(0x99)]),this[_0x1c72bf(0xa2)]();}async['disconnect'](){const _0x1ccec9=a0_0x534c7b;if(this['running']=!0x1,this[_0x1ccec9(0xcc)]?.[_0x1ccec9(0xd6)](),this[_0x1ccec9(0xae)])clearInterval(this[_0x1ccec9(0xae)]);await this[_0x1ccec9(0xb6)](_0x1ccec9(0x75))[_0x1ccec9(0xed)](()=>{}),this['log'](_0x1ccec9(0x79));}async[a0_0x534c7b(0x9b)](_0x55236e,_0x3a8459,_0x24bfc1=a0_0x534c7b(0x71)){const _0x9435c8=a0_0x534c7b;return Y({'alias':_0x55236e,'fromAlias':this[_0x9435c8(0xa5)]},{'log':_0x4db526=>console[_0x9435c8(0x82)](_0x4db526),'send':()=>this[_0x9435c8(0xd0)](_0x9435c8(0x7b),{'alias':_0x55236e,'task':_0x3a8459,'priority':_0x24bfc1,'from_session':this[_0x9435c8(0xa5)]})});}async['message'](_0xb7fb4b,_0x318d32){const _0x2ae8bd=a0_0x534c7b;return this[_0x2ae8bd(0xd0)](_0x2ae8bd(0x67),{'alias':_0xb7fb4b,'message':_0x318d32,'from_session':this[_0x2ae8bd(0xa5)]});}async[a0_0x534c7b(0xc9)](_0x435fb3,_0x42e151,_0x957a73=a0_0x534c7b(0x6e)){const _0x45c118=a0_0x534c7b;return this['call'](_0x45c118(0xd1),{'in_reply_to':_0x435fb3,'text':_0x42e151,'status':_0x957a73});}async[a0_0x534c7b(0xb6)](_0x45c9ab,_0x1ce4d6){const _0x44c196=a0_0x534c7b;return this['call'](_0x44c196(0xb9),{'resume_id':this[_0x44c196(0xcf)],'alias':this[_0x44c196(0xa5)],'status':_0x45c9ab,'server':a0_0x129268(),'hostname':a0_0x129268(),'agent':this['agent'],'project_dir':process[_0x44c196(0x83)](),..._0x1ce4d6});}async[a0_0x534c7b(0xda)](){const _0x5950b7=a0_0x534c7b;return this[_0x5950b7(0xd0)]('get_all_status',{});}async[a0_0x534c7b(0x96)](_0x163c84,_0x3e45eb){const _0x3d8b5d=a0_0x534c7b;return this[_0x3d8b5d(0xd0)](_0x3d8b5d(0x96),{'message':_0x163c84,'filter_server':_0x3e45eb?.[_0x3d8b5d(0xb4)],'filter_status':_0x3e45eb?.[_0x3d8b5d(0xb6)]});}async[a0_0x534c7b(0xa2)](){const _0x63abc1=a0_0x534c7b;let _0x4f51c0=encodeURIComponent(this[_0x63abc1(0xa5)]),_0x159568=this[_0x63abc1(0xd4)]+_0x63abc1(0x6d)+_0x4f51c0,_0x2b993a=this[_0x63abc1(0xa9)];while(this[_0x63abc1(0xe7)]){try{this[_0x63abc1(0xcc)]=new AbortController();let _0xfee657={'Accept':_0x63abc1(0xd8)};if(this[_0x63abc1(0xe8)])_0xfee657[_0x63abc1(0x93)]=_0x63abc1(0x6c)+this[_0x63abc1(0xe8)];let _0x27890c=await fetch(_0x159568,{'headers':_0xfee657,'signal':this[_0x63abc1(0xcc)][_0x63abc1(0xe3)]});if(!_0x27890c['ok']||!_0x27890c['body']){this[_0x63abc1(0x82)]('SSE\x20failed:\x20'+_0x27890c[_0x63abc1(0xb6)]),await this[_0x63abc1(0xd3)](_0x2b993a),_0x2b993a=Math[_0x63abc1(0xe2)](_0x2b993a*1.5,0xea60);continue;}_0x2b993a=this[_0x63abc1(0xa9)];let _0x3fda30=_0x27890c[_0x63abc1(0x72)][_0x63abc1(0xb0)](),_0x4cbb5d=new TextDecoder(),_0x146c5c='';while(this[_0x63abc1(0xe7)]){let {done:_0x3a83f4,value:_0x2fbbb1}=await _0x3fda30[_0x63abc1(0x74)]();if(_0x3a83f4)break;_0x146c5c+=_0x4cbb5d['decode'](_0x2fbbb1,{'stream':!0x0});let _0x5e51fb=_0x146c5c[_0x63abc1(0xea)]('\x0a');_0x146c5c=_0x5e51fb[_0x63abc1(0x68)]()||'';for(let _0x2a8259 of _0x5e51fb){if(!_0x2a8259[_0x63abc1(0xce)](_0x63abc1(0xe5)))continue;try{let _0x4c4de6=JSON['parse'](_0x2a8259[_0x63abc1(0x84)](0x6));if(_0x4c4de6[_0x63abc1(0x9f)]===_0x63abc1(0xba)){this[_0x63abc1(0x82)](_0x63abc1(0xc1)),this[_0x63abc1(0xc6)](_0x63abc1(0xba));continue;}if(_0x4c4de6[_0x63abc1(0x9f)]==='new_task'||_0x4c4de6[_0x63abc1(0x9f)]==='new_message'||_0x4c4de6[_0x63abc1(0x9f)]===_0x63abc1(0x96))await this[_0x63abc1(0x7a)]();}catch{}}}}catch(_0x327b75){if(_0x327b75[_0x63abc1(0xab)]===_0x63abc1(0xaa))break;this[_0x63abc1(0xc6)]('error',_0x327b75),this['log'](_0x63abc1(0xc5)+_0x327b75[_0x63abc1(0x90)]);}if(this[_0x63abc1(0xe7)])this[_0x63abc1(0xc6)]('disconnected'),this[_0x63abc1(0x82)](_0x63abc1(0x6a)+_0x2b993a/0x3e8+_0x63abc1(0x78)),await this[_0x63abc1(0xd3)](_0x2b993a),_0x2b993a=Math[_0x63abc1(0xe2)](_0x2b993a*1.5,0xea60);}}async[a0_0x534c7b(0x7a)](){const _0x240d2d=a0_0x534c7b;try{let _0x459a7c=(await this[_0x240d2d(0xd0)](_0x240d2d(0x7d),{'alias':this[_0x240d2d(0xa5)],'limit':0xa}))?.[_0x240d2d(0x6b)]||[];for(let _0x456b70 of _0x459a7c)await this['call']('ack_inbox',{'alias':this[_0x240d2d(0xa5)],'message_id':_0x456b70['id']}),this['log']('←\x20'+_0x456b70[_0x240d2d(0xe6)]+':\x20'+_0x456b70[_0x240d2d(0xa6)][_0x240d2d(0x84)](0x0,0x3c)),this[_0x240d2d(0xc6)](_0x240d2d(0xbe),_0x456b70),this[_0x240d2d(0xc6)](_0x240d2d(0x90),_0x456b70);}catch(_0x36dbe4){this[_0x240d2d(0x82)](_0x240d2d(0xa0)+_0x36dbe4[_0x240d2d(0x90)]);}}['sleep'](_0x43c676){return new Promise(_0x67e119=>setTimeout(_0x67e119,_0x43c676));}}var F=$;export{F as default,$ as CommHub};
|
package/dist/src/codex-menu.d.ts
CHANGED
|
@@ -30,6 +30,8 @@ export interface CollectEnv {
|
|
|
30
30
|
tmuxSessions?: () => Set<string>;
|
|
31
31
|
pidAlive?: (pid: number) => boolean;
|
|
32
32
|
}
|
|
33
|
+
export declare function realTmuxSessions(): Set<string>;
|
|
34
|
+
export declare function realPidAlive(pid: number): boolean;
|
|
33
35
|
/** Only codex nodes: co-presence (codex-app-server) and codex-sdk. */
|
|
34
36
|
export declare function collectCodexRows(nodes: CodexMenuNode[], env: CollectEnv): CodexNodeRow[];
|
|
35
37
|
export declare function renderCodexTable(rows: CodexNodeRow[], cwd: string): string;
|
|
@@ -66,10 +68,29 @@ export interface MenuIO {
|
|
|
66
68
|
readLine(prompt: string): Promise<string | null>;
|
|
67
69
|
}
|
|
68
70
|
export type Runner = (cmd: PlannedCommand) => Promise<number>;
|
|
71
|
+
export declare function pick(io: MenuIO, prompt: string, max: number, allowAdopt?: boolean): Promise<number | "adopt" | null>;
|
|
69
72
|
/** Returns the process exit code. Runs at most one command. */
|
|
70
73
|
export declare function codexMenu(rows: CodexNodeRow[], io: MenuIO, run: Runner, ctx: {
|
|
71
74
|
cwd: string;
|
|
72
75
|
}): Promise<number>;
|
|
76
|
+
/** The action step for one codex node. #561: `anet node` (all runtimes) hands codex nodes off to this. */
|
|
77
|
+
export declare function codexNodeActions(row: CodexNodeRow, io: MenuIO, run: Runner, ctx: {
|
|
78
|
+
cwd: string;
|
|
79
|
+
}): Promise<number>;
|
|
80
|
+
/** Ask for a model id; null (and a message) when none / not a plain id. Shared with node-menu.ts (#561). */
|
|
81
|
+
export declare function askModel(io: MenuIO, current: string): Promise<string | null>;
|
|
82
|
+
/**
|
|
83
|
+
* Print the exact command, then ask: y/N, or (typedName) the node's name. Run it only then.
|
|
84
|
+
* The one gate both menus go through (#532 codex, #561 every runtime).
|
|
85
|
+
*/
|
|
86
|
+
export declare function confirmAndRun(io: MenuIO, run: Runner, cmd: PlannedCommand, row: {
|
|
87
|
+
alias: string;
|
|
88
|
+
}, typedName: boolean): Promise<number>;
|
|
89
|
+
/** A line queue over one readline: scripted input that arrives in one chunk is not lost between prompts. */
|
|
90
|
+
export declare function readlineIO(): MenuIO & {
|
|
91
|
+
close(): void;
|
|
92
|
+
};
|
|
93
|
+
export declare function realRunner(beforeRun: () => void): Runner;
|
|
73
94
|
/** Entry from cli.ts (`anet node codex` with no arguments). Returns the exit code. */
|
|
74
95
|
export declare function runCodexMenu(nodes: CodexMenuNode[], opts: {
|
|
75
96
|
nodesDir: string;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { type SessionClass } from "./session-status-class";
|
|
2
|
+
export declare const UNKNOWN_HOST = "(unknown host)";
|
|
3
|
+
export type NodeLsAllArgs = {
|
|
4
|
+
all: boolean;
|
|
5
|
+
json: boolean;
|
|
6
|
+
network: string | null;
|
|
7
|
+
error: string | null;
|
|
8
|
+
};
|
|
9
|
+
/** `--all`, `--json`, `--network <id|name>` (also `--network=<v>`). */
|
|
10
|
+
export declare function parseNodeLsAllArgs(argv: string[]): NodeLsAllArgs;
|
|
11
|
+
export type HubNetwork = {
|
|
12
|
+
network_id: string;
|
|
13
|
+
network_name?: string | null;
|
|
14
|
+
member_role?: string | null;
|
|
15
|
+
};
|
|
16
|
+
export type NetworkPick = {
|
|
17
|
+
ok: true;
|
|
18
|
+
network: HubNetwork;
|
|
19
|
+
} | {
|
|
20
|
+
ok: false;
|
|
21
|
+
error: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Same matching as `anet network use <name>` (exact id or exact name), plus a unique id prefix
|
|
25
|
+
* because `anet network ls` prints 12-character id prefixes. Ambiguity is refused, never guessed.
|
|
26
|
+
*/
|
|
27
|
+
export declare function pickNetwork(networks: HubNetwork[], ref: string | null, currentId: string | null | undefined): NetworkPick;
|
|
28
|
+
export type DaemonState = "online" | "offline" | "none-visible" | "unknown";
|
|
29
|
+
export type MachineNode = {
|
|
30
|
+
alias: string;
|
|
31
|
+
node_id: string | null;
|
|
32
|
+
runtime: string | null;
|
|
33
|
+
status: string | null;
|
|
34
|
+
status_class: SessionClass;
|
|
35
|
+
last_seen_at: string | null;
|
|
36
|
+
model: string | null;
|
|
37
|
+
};
|
|
38
|
+
export type MachineDaemon = {
|
|
39
|
+
alias: string;
|
|
40
|
+
online: boolean;
|
|
41
|
+
last_seen_at: string | null;
|
|
42
|
+
};
|
|
43
|
+
export type MachineGroup = {
|
|
44
|
+
hostname: string | null;
|
|
45
|
+
/** online = at least one daemon on this host is online (remote management possible). */
|
|
46
|
+
daemon: DaemonState;
|
|
47
|
+
daemons: MachineDaemon[];
|
|
48
|
+
nodes: MachineNode[];
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* @param daemons the Hub's daemon list, or null when it could not be read (state "unknown").
|
|
52
|
+
* An empty array means "the Hub showed you none" (state "none-visible").
|
|
53
|
+
*/
|
|
54
|
+
export declare function groupNodesByMachine(sessions: any[], daemons: any[] | null): MachineGroup[];
|
|
55
|
+
/** Compact English age for a table cell. Unparseable → "?", future → "in Ns (clock skew?)". */
|
|
56
|
+
export declare function shortAgo(raw: string | null, nowMs: number): string;
|
|
57
|
+
export type FormatOpts = {
|
|
58
|
+
network: HubNetwork;
|
|
59
|
+
nowMs: number;
|
|
60
|
+
/** why the daemon list could not be read (daemons === null) */
|
|
61
|
+
daemonsError?: string | null;
|
|
62
|
+
};
|
|
63
|
+
export declare function formatMachineGroups(groups: MachineGroup[], opts: FormatOpts): string[];
|
|
64
|
+
export declare function machineGroupsJson(groups: MachineGroup[], opts: {
|
|
65
|
+
network: HubNetwork;
|
|
66
|
+
daemonsError?: string | null;
|
|
67
|
+
}): {
|
|
68
|
+
machines: {
|
|
69
|
+
hostname: string | null;
|
|
70
|
+
daemon: DaemonState;
|
|
71
|
+
daemons: MachineDaemon[];
|
|
72
|
+
nodes: MachineNode[];
|
|
73
|
+
}[];
|
|
74
|
+
daemons_error?: string | undefined;
|
|
75
|
+
network: {
|
|
76
|
+
network_id: string;
|
|
77
|
+
network_name: string | null;
|
|
78
|
+
};
|
|
79
|
+
daemons_readable: boolean;
|
|
80
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type CodexMenuNode, type CodexNodeRow, type CollectEnv, type MenuIO, type PlannedCommand, type Runner } from "./codex-menu";
|
|
2
|
+
import { type RuntimeName } from "./normalize-runtime";
|
|
3
|
+
export interface NodeRow {
|
|
4
|
+
id: string;
|
|
5
|
+
alias: string;
|
|
6
|
+
runtime: RuntimeName;
|
|
7
|
+
/** "running" | "stopped" (codex co-presence may say "partial 1/3"). */
|
|
8
|
+
state: string;
|
|
9
|
+
running: boolean;
|
|
10
|
+
model: string;
|
|
11
|
+
modelIsDefault: boolean;
|
|
12
|
+
/** Shared human + agent TUI (grok-build-cli / opencode-cli co-presence, codex-app-server). */
|
|
13
|
+
copresence: boolean;
|
|
14
|
+
/** The runtime has a TUI to enter (claude-code-cli, or any co-presence node). */
|
|
15
|
+
hasTui: boolean;
|
|
16
|
+
/** Set for codex-sdk / codex-app-server: these go to the #532 codex actions. */
|
|
17
|
+
codex: CodexNodeRow | null;
|
|
18
|
+
}
|
|
19
|
+
export declare function collectNodeRows(nodes: CodexMenuNode[], env: CollectEnv): NodeRow[];
|
|
20
|
+
export declare function renderNodeTable(rows: NodeRow[], cwd: string): string;
|
|
21
|
+
export declare const NODE_CHEAT_SHEET: string;
|
|
22
|
+
export type NodeAction = "start" | "stop" | "restart" | "attach" | "log" | "model" | "delete";
|
|
23
|
+
export declare function nodeActions(row: NodeRow): {
|
|
24
|
+
key: NodeAction;
|
|
25
|
+
label: string;
|
|
26
|
+
}[];
|
|
27
|
+
export declare function planNodeAction(row: NodeRow, action: NodeAction, input?: {
|
|
28
|
+
model?: string;
|
|
29
|
+
}): PlannedCommand;
|
|
30
|
+
/** Returns the process exit code. Runs at most one command. */
|
|
31
|
+
export declare function nodeMenu(rows: NodeRow[], io: MenuIO, run: Runner, ctx: {
|
|
32
|
+
cwd: string;
|
|
33
|
+
}): Promise<number>;
|
|
34
|
+
/** Entry from cli.ts (bare `anet node`). Returns the exit code. */
|
|
35
|
+
export declare function runNodeMenu(nodes: CodexMenuNode[], opts: {
|
|
36
|
+
nodesDir: string;
|
|
37
|
+
home: string;
|
|
38
|
+
cwd?: string;
|
|
39
|
+
usageLine?: string;
|
|
40
|
+
}): Promise<number>;
|