@sleep2agi/agent-network 2.3.0-preview.17 → 2.3.0-preview.19

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.
@@ -0,0 +1,31 @@
1
+ export interface WakeLogEntryShape {
2
+ ts?: string;
3
+ status?: string;
4
+ summary?: string;
5
+ task_id?: string;
6
+ }
7
+ export interface WakeLogGoalShape {
8
+ goal_id: string;
9
+ progress_log?: WakeLogEntryShape[];
10
+ }
11
+ export interface WakeLogRenderOpts {
12
+ /** Trim to the last N entries. undefined = all. */
13
+ tail?: number;
14
+ }
15
+ /**
16
+ * Format progress_log as a JSON object suitable for `--json` output.
17
+ * Pure. Never reads/writes filesystem. Legacy goals without
18
+ * progress_log render as empty array (not error).
19
+ */
20
+ export declare function renderWakeLogJson(goal: WakeLogGoalShape, opts?: WakeLogRenderOpts): {
21
+ goal_id: string;
22
+ total: number;
23
+ returned: number;
24
+ entries: WakeLogEntryShape[];
25
+ };
26
+ /**
27
+ * Format progress_log as a table for human console output.
28
+ * Column layout mirrors printGoalShow so the two commands read
29
+ * consistently. Empty log renders a single "(none)" line, not an error.
30
+ */
31
+ export declare function renderWakeLogText(goal: WakeLogGoalShape, opts?: WakeLogRenderOpts): string;
@@ -1 +1 @@
1
- const a0_0x1e05e3=a0_0x17ad;(function(_0xa84030,_0x2b6ba6){const _0x5cd28f=a0_0x17ad,_0x840ed=_0xa84030();while(!![]){try{const _0x399355=parseInt(_0x5cd28f(0x107))/0x1*(parseInt(_0x5cd28f(0x10d))/0x2)+parseInt(_0x5cd28f(0x106))/0x3+-parseInt(_0x5cd28f(0xe1))/0x4*(parseInt(_0x5cd28f(0xc9))/0x5)+-parseInt(_0x5cd28f(0xf7))/0x6+parseInt(_0x5cd28f(0xda))/0x7*(-parseInt(_0x5cd28f(0x114))/0x8)+parseInt(_0x5cd28f(0xd0))/0x9+parseInt(_0x5cd28f(0xd9))/0xa;if(_0x399355===_0x2b6ba6)break;else _0x840ed['push'](_0x840ed['shift']());}catch(_0x1c6911){_0x840ed['push'](_0x840ed['shift']());}}}(a0_0x541d,0xbb255));import{EventEmitter as a0_0x1d4b36}from'events';import{hostname as a0_0xf8f996}from'os';function a0_0x541d(){const _0x49f1b9=['/mcp','read','slice','url','connectSSE','2XFLsBC','task','abort','emit','min','decode','reply','6128rDFjMG','autoConnect','connected','reconnectDelay','application/json,\x20text/event-stream','getReader','application/json','normal','send_reply','SSE\x20connected','getAllStatus','processInbox','get_all_status','match','registered','error','sdk','split','call','Bearer\x20','POST','5xgKcNn','parse','inbox\x20error:\x20','result','tools/call','heartbeat\x20failed:\x20','2.0','1512963cGWYxM','pop','content','catch','name','alias','get_inbox','send','server','28635950Dmpesl','12831gaSKzJ','message','completed','sseAbort','toTimeString','offline','SSE\x20reconnecting\x20in\x20','4304392pETzQv','disconnected','send_task','cwd','running','replace','now','body','new_message','type','broadcast','SSE\x20error:\x20','startsWith','status','resumeId','sleep','AbortError','data:\x20','new_task','heartbeatTimer','send_message','/events/','6423750fECuck','toString','heartbeatInterval','ack_inbox','agent','Authorization','disconnect','idle','text','log','s...',']\x20[commhub:','messages','token','connect','2353107GhfMyv','501279iIIyeE'];a0_0x541d=function(){return _0x49f1b9;};return a0_0x541d();}class T extends a0_0x1d4b36{[a0_0x1e05e3(0x10b)];['alias'];[a0_0x1e05e3(0x104)];[a0_0x1e05e3(0xfb)];['resumeId'];[a0_0x1e05e3(0xf9)];[a0_0x1e05e3(0x117)];[a0_0x1e05e3(0xf4)];[a0_0x1e05e3(0xdd)];[a0_0x1e05e3(0xe5)]=!0x1;constructor(_0x3aef50){const _0x34362b=a0_0x1e05e3;super();if(this[_0x34362b(0x10b)]=_0x3aef50[_0x34362b(0x10b)][_0x34362b(0xe6)](/\/$/,''),this[_0x34362b(0xd5)]=_0x3aef50[_0x34362b(0xd5)],this[_0x34362b(0x104)]=_0x3aef50[_0x34362b(0x104)],this[_0x34362b(0xfb)]=_0x3aef50[_0x34362b(0xfb)]||_0x34362b(0xc4),this[_0x34362b(0xef)]='sdk-'+_0x3aef50[_0x34362b(0xd5)]+'-'+Date[_0x34362b(0xe7)]()[_0x34362b(0xf8)](0x24),this[_0x34362b(0xf9)]=_0x3aef50['heartbeatInterval']??0x2bf20,this[_0x34362b(0x117)]=_0x3aef50['reconnectDelay']??0xbb8,_0x3aef50[_0x34362b(0x115)]!==!0x1)this[_0x34362b(0x105)]();}[a0_0x1e05e3(0x100)](_0x3e191e){const _0x51ed56=a0_0x1e05e3;console['log']('['+new Date()[_0x51ed56(0xde)]()['slice'](0x0,0x8)+_0x51ed56(0x102)+this[_0x51ed56(0xd5)]+']\x20'+_0x3e191e);}async[a0_0x1e05e3(0xc6)](_0x35a2b9,_0x2e56b8){const _0x43a918=a0_0x1e05e3;let _0x5a4ee8={'Content-Type':_0x43a918(0x11a),'Accept':_0x43a918(0x118)};if(this['token'])_0x5a4ee8[_0x43a918(0xfc)]=_0x43a918(0xc7)+this[_0x43a918(0x104)];let _0x44a97b=await(await fetch(this[_0x43a918(0x10b)]+_0x43a918(0x108),{'method':_0x43a918(0xc8),'headers':_0x5a4ee8,'body':JSON['stringify']({'jsonrpc':_0x43a918(0xcf),'id':Date['now'](),'method':_0x43a918(0xcd),'params':{'name':_0x35a2b9,'arguments':_0x2e56b8}})}))[_0x43a918(0xff)](),_0x5c1b65=_0x44a97b[_0x43a918(0xc1)](/data: (.+)/),_0x380f67=_0x5c1b65?JSON[_0x43a918(0xca)](_0x5c1b65[0x1]):JSON['parse'](_0x44a97b),_0x451864=_0x380f67?.[_0x43a918(0xcc)]?.[_0x43a918(0xd2)]?.[0x0]?.[_0x43a918(0xff)];return _0x451864?JSON[_0x43a918(0xca)](_0x451864):_0x380f67;}async[a0_0x1e05e3(0x105)](){const _0x4c9801=a0_0x1e05e3;if(this[_0x4c9801(0xe5)])return;this[_0x4c9801(0xe5)]=!0x0,await this[_0x4c9801(0xee)](_0x4c9801(0xfe)),this[_0x4c9801(0x100)](_0x4c9801(0xc2)),this['heartbeatTimer']=setInterval(()=>{const _0x21aee8=_0x4c9801;this[_0x21aee8(0xee)]('idle')[_0x21aee8(0xd3)](_0x4e0cf7=>this[_0x21aee8(0x100)](_0x21aee8(0xce)+_0x4e0cf7[_0x21aee8(0xdb)]));},this['heartbeatInterval']),this['connectSSE']();}async[a0_0x1e05e3(0xfd)](){const _0x167c9d=a0_0x1e05e3;if(this[_0x167c9d(0xe5)]=!0x1,this[_0x167c9d(0xdd)]?.[_0x167c9d(0x10f)](),this[_0x167c9d(0xf4)])clearInterval(this[_0x167c9d(0xf4)]);await this[_0x167c9d(0xee)](_0x167c9d(0xdf))[_0x167c9d(0xd3)](()=>{}),this[_0x167c9d(0x100)](_0x167c9d(0xe2));}async[a0_0x1e05e3(0xd7)](_0x15d03e,_0x15b127,_0x42f0c1=a0_0x1e05e3(0x11b)){const _0x1f08e3=a0_0x1e05e3;return this[_0x1f08e3(0xc6)](_0x1f08e3(0xe3),{'alias':_0x15d03e,'task':_0x15b127,'priority':_0x42f0c1,'from_session':this[_0x1f08e3(0xd5)]});}async['message'](_0xa58786,_0x11c51b){const _0x520aca=a0_0x1e05e3;return this[_0x520aca(0xc6)](_0x520aca(0xf5),{'alias':_0xa58786,'message':_0x11c51b,'from_session':this[_0x520aca(0xd5)]});}async[a0_0x1e05e3(0x113)](_0x56f239,_0x51fd09,_0x1b9089=a0_0x1e05e3(0xdc)){const _0x1eb37c=a0_0x1e05e3;return this[_0x1eb37c(0xc6)](_0x1eb37c(0x11c),{'in_reply_to':_0x56f239,'text':_0x51fd09,'status':_0x1b9089});}async['status'](_0x4236a4,_0x4c36a0){const _0x3adb22=a0_0x1e05e3;return this[_0x3adb22(0xc6)]('report_status',{'resume_id':this[_0x3adb22(0xef)],'alias':this['alias'],'status':_0x4236a4,'server':a0_0xf8f996(),'hostname':a0_0xf8f996(),'agent':this[_0x3adb22(0xfb)],'project_dir':process[_0x3adb22(0xe4)](),..._0x4c36a0});}async[a0_0x1e05e3(0x11e)](){const _0x30e151=a0_0x1e05e3;return this['call'](_0x30e151(0xc0),{});}async[a0_0x1e05e3(0xeb)](_0x52446b,_0x16a9e1){const _0x222bb2=a0_0x1e05e3;return this[_0x222bb2(0xc6)](_0x222bb2(0xeb),{'message':_0x52446b,'filter_server':_0x16a9e1?.[_0x222bb2(0xd8)],'filter_status':_0x16a9e1?.[_0x222bb2(0xee)]});}async[a0_0x1e05e3(0x10c)](){const _0x39735f=a0_0x1e05e3;let _0x5aead5=encodeURIComponent(this['alias']),_0x5a8154=this[_0x39735f(0x10b)]+_0x39735f(0xf6)+_0x5aead5,_0x6a387e=this['reconnectDelay'];while(this[_0x39735f(0xe5)]){try{this['sseAbort']=new AbortController();let _0x396add={'Accept':'text/event-stream'};if(this[_0x39735f(0x104)])_0x396add[_0x39735f(0xfc)]=_0x39735f(0xc7)+this[_0x39735f(0x104)];let _0x36f07e=await fetch(_0x5a8154,{'headers':_0x396add,'signal':this[_0x39735f(0xdd)]['signal']});if(!_0x36f07e['ok']||!_0x36f07e['body']){this['log']('SSE\x20failed:\x20'+_0x36f07e[_0x39735f(0xee)]),await this[_0x39735f(0xf0)](_0x6a387e),_0x6a387e=Math[_0x39735f(0x111)](_0x6a387e*1.5,0xea60);continue;}_0x6a387e=this[_0x39735f(0x117)];let _0x2ec3e6=_0x36f07e[_0x39735f(0xe8)][_0x39735f(0x119)](),_0xb5aff4=new TextDecoder(),_0x21a1bf='';while(this[_0x39735f(0xe5)]){let {done:_0x30a148,value:_0x362c60}=await _0x2ec3e6[_0x39735f(0x109)]();if(_0x30a148)break;_0x21a1bf+=_0xb5aff4[_0x39735f(0x112)](_0x362c60,{'stream':!0x0});let _0x45e493=_0x21a1bf[_0x39735f(0xc5)]('\x0a');_0x21a1bf=_0x45e493[_0x39735f(0xd1)]()||'';for(let _0xca0a28 of _0x45e493){if(!_0xca0a28[_0x39735f(0xed)](_0x39735f(0xf2)))continue;try{let _0x115ee0=JSON['parse'](_0xca0a28['slice'](0x6));if(_0x115ee0[_0x39735f(0xea)]===_0x39735f(0x116)){this[_0x39735f(0x100)](_0x39735f(0x11d)),this[_0x39735f(0x110)]('connected');continue;}if(_0x115ee0[_0x39735f(0xea)]===_0x39735f(0xf3)||_0x115ee0[_0x39735f(0xea)]===_0x39735f(0xe9)||_0x115ee0[_0x39735f(0xea)]===_0x39735f(0xeb))await this[_0x39735f(0x11f)]();}catch{}}}}catch(_0x2a4069){if(_0x2a4069[_0x39735f(0xd4)]===_0x39735f(0xf1))break;this['emit'](_0x39735f(0xc3),_0x2a4069),this[_0x39735f(0x100)](_0x39735f(0xec)+_0x2a4069[_0x39735f(0xdb)]);}if(this[_0x39735f(0xe5)])this[_0x39735f(0x110)](_0x39735f(0xe2)),this['log'](_0x39735f(0xe0)+_0x6a387e/0x3e8+_0x39735f(0x101)),await this[_0x39735f(0xf0)](_0x6a387e),_0x6a387e=Math[_0x39735f(0x111)](_0x6a387e*1.5,0xea60);}}async[a0_0x1e05e3(0x11f)](){const _0xc072a7=a0_0x1e05e3;try{let _0x48fa6c=(await this[_0xc072a7(0xc6)](_0xc072a7(0xd6),{'alias':this[_0xc072a7(0xd5)],'limit':0xa}))?.[_0xc072a7(0x103)]||[];for(let _0x570824 of _0x48fa6c)await this[_0xc072a7(0xc6)](_0xc072a7(0xfa),{'alias':this[_0xc072a7(0xd5)],'message_id':_0x570824['id']}),this[_0xc072a7(0x100)]('←\x20'+_0x570824['from_session']+':\x20'+_0x570824[_0xc072a7(0xd2)][_0xc072a7(0x10a)](0x0,0x3c)),this['emit'](_0xc072a7(0x10e),_0x570824),this[_0xc072a7(0x110)](_0xc072a7(0xdb),_0x570824);}catch(_0x3795da){this['log'](_0xc072a7(0xcb)+_0x3795da['message']);}}[a0_0x1e05e3(0xf0)](_0x11b3c0){return new Promise(_0x274f3e=>setTimeout(_0x274f3e,_0x11b3c0));}}var $=T;function a0_0x17ad(_0x3fa784,_0x4b9841){_0x3fa784=_0x3fa784-0xc0;const _0x541dd4=a0_0x541d();let _0x17ada9=_0x541dd4[_0x3fa784];return _0x17ada9;}export{$ as default,T as CommHub};
1
+ const a0_0xf7069c=a0_0x4b2b;(function(_0x49d093,_0x11a5d3){const _0x7fc140=a0_0x4b2b,_0x37b4a6=_0x49d093();while(!![]){try{const _0x4448ef=parseInt(_0x7fc140(0x158))/0x1*(-parseInt(_0x7fc140(0x196))/0x2)+-parseInt(_0x7fc140(0x17c))/0x3+parseInt(_0x7fc140(0x19f))/0x4*(-parseInt(_0x7fc140(0x175))/0x5)+parseInt(_0x7fc140(0x19b))/0x6*(-parseInt(_0x7fc140(0x156))/0x7)+parseInt(_0x7fc140(0x1a5))/0x8*(-parseInt(_0x7fc140(0x1a6))/0x9)+parseInt(_0x7fc140(0x185))/0xa*(parseInt(_0x7fc140(0x191))/0xb)+-parseInt(_0x7fc140(0x181))/0xc*(-parseInt(_0x7fc140(0x1a2))/0xd);if(_0x4448ef===_0x11a5d3)break;else _0x37b4a6['push'](_0x37b4a6['shift']());}catch(_0x4e5220){_0x37b4a6['push'](_0x37b4a6['shift']());}}}(a0_0x3ae0,0x496d4));import{EventEmitter as a0_0x5c4e5b}from'events';function a0_0x3ae0(){const _0xe7d080=['pop','send','report_status','Authorization','text/event-stream','new_task','signal','11Uottcd','type','offline','autoConnect','registered','10LsyumB','send_task','s...','ack_inbox','SSE\x20reconnecting\x20in\x20','6oCIaGH','AbortError','getReader','abort','8TDGpUB','running','heartbeatTimer','406913uEhXet','normal',']\x20[commhub:','689672mlesXK','18ocucvP','from_session','emit','heartbeatInterval','application/json','reply','split','now','get_all_status','SSE\x20failed:\x20','resumeId','heartbeat\x20failed:\x20','2934624mTFhEf','data:\x20','89279BqZXth','replace','connect','reconnectDelay','SSE\x20error:\x20','connectSSE','body','disconnected','catch','error','send_message','alias','min','2.0','url','tools/call','log','getAllStatus','task','sseAbort','call','sleep','SSE\x20connected','idle','agent','cwd','send_reply','new_message','text','1115375NYgeHd','toString','broadcast','parse','status','POST','token','383724KLEwok','connected','messages','application/json,\x20text/event-stream','slice','732yHnYlD','decode','sdk-','message','34980vPZTtj','completed','get_inbox','startsWith','content'];a0_0x3ae0=function(){return _0xe7d080;};return a0_0x3ae0();}import{hostname as a0_0x242ee5}from'os';class T extends a0_0x5c4e5b{[a0_0xf7069c(0x166)];['alias'];[a0_0xf7069c(0x17b)];[a0_0xf7069c(0x170)];['resumeId'];[a0_0xf7069c(0x1a9)];[a0_0xf7069c(0x15b)];[a0_0xf7069c(0x1a1)];[a0_0xf7069c(0x16b)];['running']=!0x1;constructor(_0x519e2e){const _0x3251fc=a0_0xf7069c;super();if(this[_0x3251fc(0x166)]=_0x519e2e[_0x3251fc(0x166)][_0x3251fc(0x159)](/\/$/,''),this['alias']=_0x519e2e[_0x3251fc(0x163)],this['token']=_0x519e2e['token'],this['agent']=_0x519e2e[_0x3251fc(0x170)]||'sdk',this[_0x3251fc(0x1b0)]=_0x3251fc(0x183)+_0x519e2e[_0x3251fc(0x163)]+'-'+Date['now']()[_0x3251fc(0x176)](0x24),this[_0x3251fc(0x1a9)]=_0x519e2e[_0x3251fc(0x1a9)]??0x2bf20,this['reconnectDelay']=_0x519e2e[_0x3251fc(0x15b)]??0xbb8,_0x519e2e[_0x3251fc(0x194)]!==!0x1)this[_0x3251fc(0x15a)]();}['log'](_0x49a14b){const _0x2943d5=a0_0xf7069c;console['log']('['+new Date()['toTimeString']()['slice'](0x0,0x8)+_0x2943d5(0x1a4)+this[_0x2943d5(0x163)]+']\x20'+_0x49a14b);}async[a0_0xf7069c(0x16c)](_0x469f81,_0x90cc78){const _0x15609a=a0_0xf7069c;let _0x337fd4={'Content-Type':_0x15609a(0x1aa),'Accept':_0x15609a(0x17f)};if(this[_0x15609a(0x17b)])_0x337fd4[_0x15609a(0x18d)]='Bearer\x20'+this[_0x15609a(0x17b)];let _0x2744c1=await(await fetch(this[_0x15609a(0x166)]+'/mcp',{'method':_0x15609a(0x17a),'headers':_0x337fd4,'body':JSON['stringify']({'jsonrpc':_0x15609a(0x165),'id':Date[_0x15609a(0x1ad)](),'method':_0x15609a(0x167),'params':{'name':_0x469f81,'arguments':_0x90cc78}})}))[_0x15609a(0x174)](),_0x2dc017=_0x2744c1['match'](/data: (.+)/),_0x32c9ba=_0x2dc017?JSON[_0x15609a(0x178)](_0x2dc017[0x1]):JSON[_0x15609a(0x178)](_0x2744c1),_0x4ea9ce=_0x32c9ba?.['result']?.[_0x15609a(0x189)]?.[0x0]?.[_0x15609a(0x174)];return _0x4ea9ce?JSON[_0x15609a(0x178)](_0x4ea9ce):_0x32c9ba;}async[a0_0xf7069c(0x15a)](){const _0x932849=a0_0xf7069c;if(this[_0x932849(0x1a0)])return;this[_0x932849(0x1a0)]=!0x0,await this[_0x932849(0x179)](_0x932849(0x16f)),this[_0x932849(0x168)](_0x932849(0x195)),this[_0x932849(0x1a1)]=setInterval(()=>{const _0x414973=_0x932849;this[_0x414973(0x179)]('idle')[_0x414973(0x160)](_0x2b8ee6=>this[_0x414973(0x168)](_0x414973(0x155)+_0x2b8ee6['message']));},this[_0x932849(0x1a9)]),this[_0x932849(0x15d)]();}async['disconnect'](){const _0x224ba3=a0_0xf7069c;if(this[_0x224ba3(0x1a0)]=!0x1,this[_0x224ba3(0x16b)]?.[_0x224ba3(0x19e)](),this[_0x224ba3(0x1a1)])clearInterval(this['heartbeatTimer']);await this[_0x224ba3(0x179)](_0x224ba3(0x193))[_0x224ba3(0x160)](()=>{}),this['log'](_0x224ba3(0x15f));}async[a0_0xf7069c(0x18b)](_0x63ef67,_0x2de9b9,_0x22894f=a0_0xf7069c(0x1a3)){const _0x236b06=a0_0xf7069c;return this[_0x236b06(0x16c)](_0x236b06(0x197),{'alias':_0x63ef67,'task':_0x2de9b9,'priority':_0x22894f,'from_session':this[_0x236b06(0x163)]});}async[a0_0xf7069c(0x184)](_0x195ba2,_0x523c4b){const _0x16189a=a0_0xf7069c;return this[_0x16189a(0x16c)](_0x16189a(0x162),{'alias':_0x195ba2,'message':_0x523c4b,'from_session':this[_0x16189a(0x163)]});}async[a0_0xf7069c(0x1ab)](_0x1bdc71,_0x599073,_0x410624=a0_0xf7069c(0x186)){const _0x23118c=a0_0xf7069c;return this['call'](_0x23118c(0x172),{'in_reply_to':_0x1bdc71,'text':_0x599073,'status':_0x410624});}async[a0_0xf7069c(0x179)](_0x227f1e,_0x105f89){const _0x3278c1=a0_0xf7069c;return this[_0x3278c1(0x16c)](_0x3278c1(0x18c),{'resume_id':this[_0x3278c1(0x1b0)],'alias':this[_0x3278c1(0x163)],'status':_0x227f1e,'server':a0_0x242ee5(),'hostname':a0_0x242ee5(),'agent':this[_0x3278c1(0x170)],'project_dir':process[_0x3278c1(0x171)](),..._0x105f89});}async[a0_0xf7069c(0x169)](){const _0x2be074=a0_0xf7069c;return this[_0x2be074(0x16c)](_0x2be074(0x1ae),{});}async[a0_0xf7069c(0x177)](_0x2843a1,_0x7f0b97){const _0x5be3b2=a0_0xf7069c;return this[_0x5be3b2(0x16c)](_0x5be3b2(0x177),{'message':_0x2843a1,'filter_server':_0x7f0b97?.['server'],'filter_status':_0x7f0b97?.[_0x5be3b2(0x179)]});}async[a0_0xf7069c(0x15d)](){const _0x2d0c71=a0_0xf7069c;let _0x42e333=encodeURIComponent(this['alias']),_0xc34251=this[_0x2d0c71(0x166)]+'/events/'+_0x42e333,_0x3366b0=this[_0x2d0c71(0x15b)];while(this[_0x2d0c71(0x1a0)]){try{this[_0x2d0c71(0x16b)]=new AbortController();let _0x435f08={'Accept':_0x2d0c71(0x18e)};if(this[_0x2d0c71(0x17b)])_0x435f08[_0x2d0c71(0x18d)]='Bearer\x20'+this['token'];let _0x36ae19=await fetch(_0xc34251,{'headers':_0x435f08,'signal':this[_0x2d0c71(0x16b)][_0x2d0c71(0x190)]});if(!_0x36ae19['ok']||!_0x36ae19[_0x2d0c71(0x15e)]){this[_0x2d0c71(0x168)](_0x2d0c71(0x1af)+_0x36ae19[_0x2d0c71(0x179)]),await this['sleep'](_0x3366b0),_0x3366b0=Math[_0x2d0c71(0x164)](_0x3366b0*1.5,0xea60);continue;}_0x3366b0=this[_0x2d0c71(0x15b)];let _0x2093ac=_0x36ae19['body'][_0x2d0c71(0x19d)](),_0x17c1b5=new TextDecoder(),_0x1f19ef='';while(this[_0x2d0c71(0x1a0)]){let {done:_0x32d115,value:_0xce1e48}=await _0x2093ac['read']();if(_0x32d115)break;_0x1f19ef+=_0x17c1b5[_0x2d0c71(0x182)](_0xce1e48,{'stream':!0x0});let _0x197f68=_0x1f19ef[_0x2d0c71(0x1ac)]('\x0a');_0x1f19ef=_0x197f68[_0x2d0c71(0x18a)]()||'';for(let _0x53a09e of _0x197f68){if(!_0x53a09e[_0x2d0c71(0x188)](_0x2d0c71(0x157)))continue;try{let _0x5a729b=JSON[_0x2d0c71(0x178)](_0x53a09e[_0x2d0c71(0x180)](0x6));if(_0x5a729b['type']===_0x2d0c71(0x17d)){this[_0x2d0c71(0x168)](_0x2d0c71(0x16e)),this['emit'](_0x2d0c71(0x17d));continue;}if(_0x5a729b['type']===_0x2d0c71(0x18f)||_0x5a729b['type']===_0x2d0c71(0x173)||_0x5a729b[_0x2d0c71(0x192)]===_0x2d0c71(0x177))await this['processInbox']();}catch{}}}}catch(_0x219375){if(_0x219375['name']===_0x2d0c71(0x19c))break;this['emit'](_0x2d0c71(0x161),_0x219375),this[_0x2d0c71(0x168)](_0x2d0c71(0x15c)+_0x219375['message']);}if(this[_0x2d0c71(0x1a0)])this[_0x2d0c71(0x1a8)](_0x2d0c71(0x15f)),this[_0x2d0c71(0x168)](_0x2d0c71(0x19a)+_0x3366b0/0x3e8+_0x2d0c71(0x198)),await this[_0x2d0c71(0x16d)](_0x3366b0),_0x3366b0=Math[_0x2d0c71(0x164)](_0x3366b0*1.5,0xea60);}}async['processInbox'](){const _0x792ecb=a0_0xf7069c;try{let _0x404359=(await this[_0x792ecb(0x16c)](_0x792ecb(0x187),{'alias':this['alias'],'limit':0xa}))?.[_0x792ecb(0x17e)]||[];for(let _0x36e20e of _0x404359)await this['call'](_0x792ecb(0x199),{'alias':this['alias'],'message_id':_0x36e20e['id']}),this[_0x792ecb(0x168)]('←\x20'+_0x36e20e[_0x792ecb(0x1a7)]+':\x20'+_0x36e20e[_0x792ecb(0x189)][_0x792ecb(0x180)](0x0,0x3c)),this[_0x792ecb(0x1a8)](_0x792ecb(0x16a),_0x36e20e),this['emit'](_0x792ecb(0x184),_0x36e20e);}catch(_0x2ed335){this[_0x792ecb(0x168)]('inbox\x20error:\x20'+_0x2ed335['message']);}}['sleep'](_0xa49fac){return new Promise(_0x2c24b6=>setTimeout(_0x2c24b6,_0xa49fac));}}function a0_0x4b2b(_0x3cc90a,_0x43758b){_0x3cc90a=_0x3cc90a-0x155;const _0x3ae0cf=a0_0x3ae0();let _0x4b2b27=_0x3ae0cf[_0x3cc90a];return _0x4b2b27;}var $=T;export{$ as default,T as CommHub};
@@ -0,0 +1,14 @@
1
+ /** Parse the environ blob (NUL-separated key=val) and return the
2
+ * COMMHUB_ALIAS value if present, else null. Exported for testing. */
3
+ export declare function parseEnvironAlias(environBlob: string): string | null;
4
+ /** Read /proc/<pid>/environ and return the COMMHUB_ALIAS value.
5
+ * Any file-read error (not-a-Linux, permission denied, race with
6
+ * process exit) returns null — caller must not fail-closed on that
7
+ * (the process is stale/gone/inaccessible, not our problem). */
8
+ export declare function readEnvironAlias(pid: number): string | null;
9
+ /** Scan /proc for pids whose COMMHUB_ALIAS env matches any of the
10
+ * target aliases. Linux-only (procfs); returns null on non-Linux or
11
+ * when /proc is unreadable — caller MUST fail-closed on null per
12
+ * the same #180 R2 fail-closed contract as findNodeProcessesByAlias.
13
+ * Self-pid + init (PID 1) are excluded. */
14
+ export declare function findEnvironAliasMatches(aliases: Iterable<string>, selfPid: number): number[] | null;