@univer-cli/daemon 1.4.0 → 1.5.2
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/README.md +2 -2
- package/README.zh-CN.md +2 -2
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
English | [简体中文](./README.zh-CN.md)
|
|
4
4
|
|
|
5
|
-
Let multiple short-lived local processes reuse the same resident Node.js process and send JSON requests over a Unix socket or Windows named pipe.
|
|
5
|
+
Let multiple short-lived local processes reuse the same resident Node.js process and send JSON requests over a [Unix socket or Windows named pipe](https://nodejs.org/api/net.html#ipc-support).
|
|
6
6
|
|
|
7
7
|
It is intended for services with high startup costs or in-memory state that must survive across CLI invocations. If the logic can run directly in the current process, or an HTTP or queue-based service boundary already exists, this package is unnecessary.
|
|
8
8
|
|
|
@@ -63,7 +63,7 @@ import { createDaemonClient } from "@univer-cli/daemon";
|
|
|
63
63
|
const client = createDaemonClient({
|
|
64
64
|
entry: new URL("./counter-daemon.js", import.meta.url),
|
|
65
65
|
identity: { id: "my-cli", version: "1.2.0" },
|
|
66
|
-
socketPath: "/tmp/my-cli.sock",
|
|
66
|
+
socketPath: process.platform === "win32" ? "\\\\.\\pipe\\my-cli" : "/tmp/my-cli.sock",
|
|
67
67
|
});
|
|
68
68
|
|
|
69
69
|
const result = await client.request("counter.add", 2);
|
package/README.zh-CN.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[English](./README.md) | 简体中文
|
|
4
4
|
|
|
5
|
-
让多个短生命周期的本地进程复用同一个常驻 Node.js 进程,并通过 Unix socket 或 Windows named pipe 发送
|
|
5
|
+
让多个短生命周期的本地进程复用同一个常驻 Node.js 进程,并通过 [Unix socket 或 Windows named pipe](https://nodejs.org/api/net.html#ipc-support) 发送
|
|
6
6
|
JSON 请求。
|
|
7
7
|
|
|
8
8
|
它适合启动成本高、需要在多次 CLI 调用之间保留内存状态的服务。若逻辑可以直接在当前进程执行,或已有 HTTP、
|
|
@@ -66,7 +66,7 @@ import { createDaemonClient } from "@univer-cli/daemon";
|
|
|
66
66
|
const client = createDaemonClient({
|
|
67
67
|
entry: new URL("./counter-daemon.js", import.meta.url),
|
|
68
68
|
identity: { id: "my-cli", version: "1.2.0" },
|
|
69
|
-
socketPath: "/tmp/my-cli.sock",
|
|
69
|
+
socketPath: process.platform === "win32" ? "\\\\.\\pipe\\my-cli" : "/tmp/my-cli.sock",
|
|
70
70
|
});
|
|
71
71
|
|
|
72
72
|
const result = await client.request("counter.add", 2);
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x54e57c=_0x4aa2;(function(_0x32c009,_0x4f31af){const _0x105dcc=_0x4aa2,_0x45ae56=_0x32c009();while(!![]){try{const _0x31ad34=-parseInt(_0x105dcc(0xe3))/0x1*(-parseInt(_0x105dcc(0xa9))/0x2)+-parseInt(_0x105dcc(0xc3))/0x3+-parseInt(_0x105dcc(0xcd))/0x4+parseInt(_0x105dcc(0x74))/0x5*(-parseInt(_0x105dcc(0xa3))/0x6)+-parseInt(_0x105dcc(0x84))/0x7*(parseInt(_0x105dcc(0x79))/0x8)+parseInt(_0x105dcc(0xce))/0x9+parseInt(_0x105dcc(0xd9))/0xa;if(_0x31ad34===_0x4f31af)break;else _0x45ae56['push'](_0x45ae56['shift']());}catch(_0x33760f){_0x45ae56['push'](_0x45ae56['shift']());}}}(_0x283b,0x2aee2));import{randomUUID as _0x48e3de}from'node:crypto';import{spawn as _0xaca769}from'node:child_process';import{connect as _0x3170d1,createServer as _0x2fdfa0}from'node:net';function _0x283b(){const _0x373125=['start','1219340mRKPmc','2517660lQwpZM','set','DAEMON_CONNECTION_CLOSED','off','object','identity.id','result','unref','identity-mismatch','execPath','stringify','4511290jodJZj','Daemon\x20did\x20not\x20stop\x20within\x20','Daemon\x20server\x20is\x20closed','running','Refusing\x20to\x20replace\x20non-socket\x20path\x20','legacy-protocol','Daemon\x20entry\x20must\x20be\x20an\x20absolute\x20file\x20URL','status','Invalid\x20daemon\x20request','startedAt','1HsQnyf','protocolVersion','actual','close','EPIPE','Daemon\x20did\x20not\x20start\x20within\x20','Daemon\x20method\x20','DAEMON_STOP_TIMEOUT','daemon.shutdown','clear','connect','buildId','Daemon\x20request\x20timed\x20out\x20after\x20','destroy','15AwxEnc','isSocket','build-id-mismatch','isSafeInteger','code','134296Ygzvkk','unreachable','push','entry','add','env','parse','startTimeoutMs','now','ignore','assign','63TkYGGo','stopped','onShutdown','isNaN','exitCode','ENOENT','listen','UNIVER_CLI_SDK_DAEMON_SOCKET','Daemon\x20is\x20not\x20ready:\x20','slice','Daemon\x20method\x20must\x20not\x20be\x20empty','\x20must\x20not\x20be\x20empty','isArray','Daemon\x20handlers\x20must\x20be\x20registered\x20before\x20listen()','options','pid','DAEMON_INVALID_REQUEST','utf8','incompatible','trim','method','\x20must\x20be\x20a\x20finite\x20positive\x20number','once','DAEMON_START_TIMEOUT','version','\x20is\x20already\x20registered','indexOf','identity','identity.version','daemon.','state','42414NJctSJ','requestTimeoutMs','string','protocol','DAEMON_UNREACHABLE','DAEMON_METHOD_NOT_FOUND','388458SwJUOC','startsWith','stopTimeoutMs','DAEMON_CONTROL_INVALID_RESPONSE','file:','protocol-mismatch','href','end','DAEMON_INCOMPATIBLE','unknown','type','socketPath\x20must\x20not\x20be\x20empty','number','daemon.status','ready','payload','socketPath','name','diagnostic','Daemon\x20connection\x20closed\x20before\x20a\x20response\x20was\x20received','Invalid\x20daemon\x20response','version-mismatch','Daemon\x20server\x20has\x20not\x20started\x20listening','write','reason','A\x20daemon\x20is\x20already\x20listening\x20on\x20','816393FYOVQs','error','message','length','ECONNREFUSED','identity.buildId','catch','timeoutMs','Daemon\x20is\x20not\x20listening\x20on\x20'];_0x283b=function(){return _0x373125;};return _0x283b();}import{fileURLToPath as _0x230842}from'node:url';import{StringDecoder as _0x2a288b}from'node:string_decoder';import{lstat as _0x4889f6,mkdir as _0x12a201,unlink as _0x4c125a}from'node:fs/promises';import{dirname as _0x16fba8}from'node:path';function u(_0x5a8bbb){const _0x535bcf=_0x4aa2;return JSON[_0x535bcf(0xd8)](_0x5a8bbb)+'\x0a';}function d(_0x49c2f8){const _0x3351d6=_0x4aa2;let _0x163164='',_0x5d1427=new _0x2a288b(_0x3351d6(0x95));return{'end'(){const _0x5255c1=_0x3351d6;_0x163164+=_0x5d1427[_0x5255c1(0xb0)](),_0x163164[_0x5255c1(0x97)]()[_0x5255c1(0xc6)]>0x0&&_0x49c2f8(_0x163164),_0x163164='';},'push'(_0x45b0c3){const _0x59dc95=_0x3351d6;for(_0x163164+=_0x5d1427[_0x59dc95(0xc0)](_0x45b0c3);;){let _0x3a1411=_0x163164[_0x59dc95(0x9e)]('\x0a');if(_0x3a1411<0x0)return;let _0x1ba04d=_0x163164['slice'](0x0,_0x3a1411);_0x163164=_0x163164[_0x59dc95(0x8d)](_0x3a1411+0x1),_0x1ba04d['trim']()[_0x59dc95(0xc6)]>0x0&&_0x49c2f8(_0x1ba04d);}}};}function _0x4aa2(_0x47601d,_0x445916){_0x47601d=_0x47601d-0x70;const _0x283b47=_0x283b();let _0x4aa269=_0x283b47[_0x47601d];return _0x4aa269;}var f=_0x54e57c(0x8b);async function p(_0x114cb5){const _0x256ca0=_0x54e57c;_0xaca769(process[_0x256ca0(0xd7)],[_0x230842(_0x114cb5[_0x256ca0(0x7c)])],{'detached':!0x0,'env':{...process.env,..._0x114cb5[_0x256ca0(0x92)][_0x256ca0(0x7e)],[f]:_0x114cb5[_0x256ca0(0x92)][_0x256ca0(0xb9)]},'stdio':_0x256ca0(0x82)})[_0x256ca0(0xd5)]();let _0x39458d=Date[_0x256ca0(0x81)]();for(;Date['now']()-_0x39458d<_0x114cb5[_0x256ca0(0xca)];){try{return await _0x114cb5[_0x256ca0(0xb7)]();}catch(_0x5c5b06){if(!g(_0x5c5b06))throw _0x5c5b06;}await new Promise(_0x128f59=>setTimeout(_0x128f59,0x19));}throw Object[_0x256ca0(0x83)](Error(_0x256ca0(0xe8)+String(_0x114cb5[_0x256ca0(0xca)])+'ms'),{'code':_0x256ca0(0x9b)});}function m(_0x4dea3f,_0x14d073,_0x1b8e9a,_0x297f8b){return new Promise((_0x52ff8a,_0x4b9261)=>{const _0x51d917=_0x4aa2;let _0x248ef8=_0x3170d1(_0x4dea3f),_0x1908b5=_0x48e3de(),_0x3264b7=!0x1,_0x37465f=setTimeout(()=>{const _0x21d0b3=_0x4aa2;_0x248ef8[_0x21d0b3(0x73)](),_0x4b9261(Object[_0x21d0b3(0x83)](Error(_0x21d0b3(0x72)+String(_0x297f8b)+'ms'),{'code':'DAEMON_REQUEST_TIMEOUT'}));},_0x297f8b),_0xb007aa=_0x19f96b=>{_0x3264b7||(_0x3264b7=!0x0,clearTimeout(_0x37465f),_0x19f96b());},_0x7237cc=d(_0x48f822=>{try{let _0x111d93=v(_0x48f822,_0x1908b5);_0xb007aa(()=>{const _0x514762=_0x4aa2;_0x248ef8[_0x514762(0xb0)](),_0x111d93[_0x514762(0xb3)]==='error'?_0x4b9261(y(_0x111d93[_0x514762(0xc4)])):_0x52ff8a(_0x111d93[_0x514762(0xd4)]);});}catch(_0xd8d6bb){_0xb007aa(()=>{const _0x2cf922=_0x4aa2;_0x248ef8[_0x2cf922(0x73)](),_0x4b9261(_0xd8d6bb);});}});_0x248ef8['once'](_0x51d917(0xc4),_0x5674c0=>_0xb007aa(()=>{const _0x3c2a6c=_0x51d917;_0x248ef8[_0x3c2a6c(0x73)](),_0x4b9261(_0x5674c0);})),_0x248ef8['on']('data',_0x55f51a=>_0x7237cc['push'](_0x55f51a)),_0x248ef8['on']('end',()=>{const _0x2238b8=_0x51d917;_0x7237cc[_0x2238b8(0xb0)](),_0xb007aa(()=>{const _0x2b433f=_0x2238b8;_0x248ef8[_0x2b433f(0x73)](),_0x4b9261(_());});}),_0x248ef8['on']('close',()=>_0xb007aa(()=>{const _0x432e8a=_0x51d917;_0x248ef8[_0x432e8a(0x73)](),_0x4b9261(_());})),_0x248ef8[_0x51d917(0x9a)]('connect',()=>{const _0x5ce32b=_0x51d917;_0x248ef8[_0x5ce32b(0xc0)](u({'id':_0x1908b5,'method':_0x14d073,'payload':_0x1b8e9a}));});});}function h(_0x97fd41){const _0x4a4c5e=_0x54e57c;let _0x50b634=_0x97fd41 instanceof URL?_0x97fd41['href']:_0x97fd41;try{let _0x261d88=new URL(_0x50b634);if(_0x261d88[_0x4a4c5e(0xa6)]!==_0x4a4c5e(0xad))throw Error();return _0x261d88[_0x4a4c5e(0xaf)];}catch{throw Error(_0x4a4c5e(0xdf));}}function g(_0x1a88f8){const _0x4f9640=_0x54e57c;return b(_0x1a88f8)?_0x1a88f8[_0x4f9640(0x78)]===_0x4f9640(0x89)||_0x1a88f8['code']==='ECONNREFUSED':!0x1;}function _(){const _0x4f46c1=_0x54e57c;return Object[_0x4f46c1(0x83)](Error(_0x4f46c1(0xbc)),{'code':_0x4f46c1(0xd0)});}function v(_0x418ac6,_0x589601){const _0x36908c=_0x54e57c;let _0x3fbbcf=JSON[_0x36908c(0x7f)](_0x418ac6);if(!b(_0x3fbbcf)||_0x3fbbcf['id']!==_0x589601)throw Error(_0x36908c(0xbd));if(_0x3fbbcf[_0x36908c(0xb3)]===_0x36908c(0xd4)&&_0x36908c(0xd4)in _0x3fbbcf||_0x3fbbcf[_0x36908c(0xb3)]===_0x36908c(0xc4)&&b(_0x3fbbcf['error']))return _0x3fbbcf;throw Error(_0x36908c(0xbd));}function y(_0x3f0c70){const _0x22b496=_0x54e57c;let _0x53d0e8=Error(_0x3f0c70['message']);return _0x3f0c70['code']!==void 0x0&&Object[_0x22b496(0x83)](_0x53d0e8,{'code':_0x3f0c70[_0x22b496(0x78)]}),_0x53d0e8[_0x22b496(0xba)]=_0x3f0c70['name'],_0x53d0e8;}function b(_0x744466){const _0x3b6baa=_0x54e57c;return typeof _0x744466=='object'&&!!_0x744466&&!Array[_0x3b6baa(0x90)](_0x744466);}function x(_0x5d5bf0){const _0xbec57f=_0x54e57c;C(_0x5d5bf0['id'],_0xbec57f(0xd3)),C(_0x5d5bf0[_0xbec57f(0x9c)],_0xbec57f(0xa0)),_0x5d5bf0[_0xbec57f(0x71)]!==void 0x0&&C(_0x5d5bf0[_0xbec57f(0x71)],_0xbec57f(0xc8));}function S(_0x42e813){const _0x334052=_0x54e57c;return ee(_0x42e813)&&typeof _0x42e813['id']==_0x334052(0xa5)&&_0x42e813['id'][_0x334052(0xc6)]>0x0&&typeof _0x42e813[_0x334052(0x9c)]==_0x334052(0xa5)&&_0x42e813[_0x334052(0x9c)]['length']>0x0&&(_0x42e813[_0x334052(0x71)]===void 0x0||typeof _0x42e813[_0x334052(0x71)]==_0x334052(0xa5)&&_0x42e813[_0x334052(0x71)]['length']>0x0);}function C(_0x25d1c6,_0x348e0b){const _0x572500=_0x54e57c;if(_0x25d1c6[_0x572500(0xc6)]===0x0)throw Error(_0x348e0b+_0x572500(0x8f));}function ee(_0x397ea8){const _0x1922a9=_0x54e57c;return typeof _0x397ea8==_0x1922a9(0xd2)&&!!_0x397ea8&&!Array['isArray'](_0x397ea8);}var w=0x1,T=_0x54e57c(0xb6),E=_0x54e57c(0xeb);function D(_0x3b0d4b){const _0x86334a=_0x54e57c;return _0x3b0d4b[_0x86334a(0xaa)](_0x86334a(0xa1));}var O=0x2710,k=0x19;function A(_0x27b38e){const _0x3734b1=_0x54e57c;x(_0x27b38e['identity']);let _0x2eb4a6=h(_0x27b38e[_0x3734b1(0x7c)]),_0x3b5234=_0x27b38e[_0x3734b1(0xa4)]??0x7530,_0x3efe99=_0x27b38e[_0x3734b1(0x80)]??0x2710,_0x131301=_0x27b38e[_0x3734b1(0xab)]??O;B(_0x3b5234,_0x3734b1(0xa4)),B(_0x3efe99,_0x3734b1(0x80)),B(_0x131301,_0x3734b1(0xab));let _0x246691=()=>({'socketPath':_0x27b38e[_0x3734b1(0xb9)],'state':_0x3734b1(0x85)}),_0x43ae53=async()=>{const _0x30b35b=_0x3734b1;try{let _0x53ae75=P(await m(_0x27b38e[_0x30b35b(0xb9)],T,null,_0x3b5234),_0x27b38e[_0x30b35b(0xb9)]),_0x551f22=te(_0x27b38e[_0x30b35b(0x9f)],_0x53ae75);return _0x551f22===void 0x0?_0x53ae75:ne(_0x27b38e[_0x30b35b(0x9f)],_0x53ae75,_0x551f22,_0x27b38e[_0x30b35b(0xb9)]);}catch(_0x2c6c87){if(g(_0x2c6c87))return _0x246691();let _0x117c96=R(_0x2c6c87);return _0x117c96['code']===_0x30b35b(0xa8)?M(_0x27b38e[_0x30b35b(0x9f)],_0x30b35b(0xde),_0x27b38e['socketPath'],_0x117c96):_0x117c96[_0x30b35b(0x78)]===_0x30b35b(0xac)?M(_0x27b38e[_0x30b35b(0x9f)],'invalid-health',_0x27b38e[_0x30b35b(0xb9)],_0x117c96):{'diagnostic':_0x117c96,'socketPath':_0x27b38e[_0x30b35b(0xb9)],'state':_0x30b35b(0x7a)};}},_0x5ddcf5=async()=>{const _0x3e61f1=_0x3734b1;let _0x2944a0=await _0x43ae53();if(_0x2944a0['state']===_0x3e61f1(0xdc))return{..._0x2944a0,'started':!0x1};if(_0x2944a0[_0x3e61f1(0xa2)]!==_0x3e61f1(0x85))throw N(_0x2944a0);return{...await p({'entry':_0x2eb4a6,'options':_0x27b38e,'ready':async()=>{const _0x31dfc2=_0x3e61f1;let _0x4aecf9=await _0x43ae53();if(_0x4aecf9['state']===_0x31dfc2(0x85))throw I(_0x27b38e['socketPath']);if(_0x4aecf9['state']!==_0x31dfc2(0xdc))throw N(_0x4aecf9);return _0x4aecf9;},'timeoutMs':_0x3efe99}),'started':!0x0};},_0x39f6b2=async()=>{const _0x53623b=_0x3734b1;let _0xddf585=await _0x43ae53();if(_0xddf585['state']==='stopped')return{..._0xddf585,'stopped':!0x1};if(_0xddf585[_0x53623b(0xa2)]!==_0x53623b(0xdc)&&!j(_0xddf585))throw N(_0xddf585);try{await m(_0x27b38e[_0x53623b(0xb9)],E,null,_0x3b5234);}catch(_0x49b1de){if(!L(_0x49b1de))throw _0x49b1de;}return await F(_0x43ae53,_0x131301),{..._0x246691(),'stopped':!0x0};};return{async 'restart'(){const _0x11a0b0=_0x3734b1;let _0x41fade=await _0x43ae53();if(_0x41fade['state']!==_0x11a0b0(0xdc)&&_0x41fade['state']!==_0x11a0b0(0x85)&&!j(_0x41fade))throw N(_0x41fade);(_0x41fade[_0x11a0b0(0xa2)]===_0x11a0b0(0xdc)||j(_0x41fade))&&await _0x39f6b2();let _0x55e0bb=await _0x5ddcf5(),_0xb4d9c4=_0x41fade[_0x11a0b0(0xa2)]===_0x11a0b0(0xdc)?_0x41fade[_0x11a0b0(0x93)]:j(_0x41fade)?_0x41fade[_0x11a0b0(0xe5)][_0x11a0b0(0x93)]:void 0x0;return{'identity':_0x55e0bb[_0x11a0b0(0x9f)],'pid':_0x55e0bb[_0x11a0b0(0x93)],..._0xb4d9c4===void 0x0?{}:{'previousPid':_0xb4d9c4},'restarted':_0x41fade[_0x11a0b0(0xa2)]!=='stopped','protocolVersion':_0x55e0bb['protocolVersion'],'socketPath':_0x55e0bb[_0x11a0b0(0xb9)],'startedAt':_0x55e0bb[_0x11a0b0(0xe2)],'state':_0x11a0b0(0xdc)};},'start':_0x5ddcf5,'status':_0x43ae53,'stop':_0x39f6b2};}function j(_0x1042f4){const _0x3fbea1=_0x54e57c;return _0x1042f4[_0x3fbea1(0xa2)]===_0x3fbea1(0x96)&&_0x1042f4[_0x3fbea1(0xe5)]!==void 0x0&&(_0x1042f4[_0x3fbea1(0xc1)]===_0x3fbea1(0xbe)||_0x1042f4[_0x3fbea1(0xc1)]===_0x3fbea1(0x76));}function te(_0x4b3577,_0x3d5b5a){const _0x2a310e=_0x54e57c;if(_0x3d5b5a[_0x2a310e(0xe4)]!==0x1)return _0x2a310e(0xae);if(_0x3d5b5a[_0x2a310e(0x9f)]['id']!==_0x4b3577['id'])return _0x2a310e(0xd6);if(_0x3d5b5a[_0x2a310e(0x9f)]['version']!==_0x4b3577[_0x2a310e(0x9c)])return'version-mismatch';if(_0x4b3577[_0x2a310e(0x71)]!==void 0x0&&_0x3d5b5a[_0x2a310e(0x9f)][_0x2a310e(0x71)]!==_0x4b3577[_0x2a310e(0x71)])return _0x2a310e(0x76);}function ne(_0x1e254e,_0x5684b3,_0x176b13,_0x27a8b2){const _0x3aa91a=_0x54e57c;return{'actual':{'identity':_0x5684b3[_0x3aa91a(0x9f)],'pid':_0x5684b3[_0x3aa91a(0x93)],'protocolVersion':_0x5684b3[_0x3aa91a(0xe4)],'socketPath':_0x5684b3[_0x3aa91a(0xb9)],'startedAt':_0x5684b3[_0x3aa91a(0xe2)]},'expected':{'identity':_0x1e254e,'protocolVersion':0x1},'reason':_0x176b13,'socketPath':_0x27a8b2,'state':_0x3aa91a(0x96)};}function M(_0x14749f,_0x421b1a,_0x594c88,_0x42b652){const _0x36afd4=_0x54e57c;return{'diagnostic':_0x42b652,'expected':{'identity':_0x14749f,'protocolVersion':0x1},'reason':_0x421b1a,'socketPath':_0x594c88,'state':_0x36afd4(0x96)};}function N(_0x9c8383){const _0x1c1378=_0x54e57c;let _0x36518f=_0x9c8383[_0x1c1378(0xa2)]===_0x1c1378(0x96)?_0x9c8383['reason']:_0x9c8383[_0x1c1378(0xbb)]['message'];return z(_0x9c8383[_0x1c1378(0xa2)]===_0x1c1378(0x96)?_0x1c1378(0xb1):_0x1c1378(0xa7),_0x1c1378(0x8c)+_0x36518f);}function P(_0x24cb75,_0xb7ba3f){const _0xd5bbc3=_0x54e57c;if(!V(_0x24cb75)||_0x24cb75[_0xd5bbc3(0xa2)]!=='running'||_0x24cb75[_0xd5bbc3(0xb9)]!==_0xb7ba3f||!S(_0x24cb75[_0xd5bbc3(0x9f)])||typeof _0x24cb75[_0xd5bbc3(0x93)]!=_0xd5bbc3(0xb5)||!Number[_0xd5bbc3(0x77)](_0x24cb75[_0xd5bbc3(0x93)])||_0x24cb75[_0xd5bbc3(0x93)]<=0x0||typeof _0x24cb75[_0xd5bbc3(0xe4)]!=_0xd5bbc3(0xb5)||!Number['isSafeInteger'](_0x24cb75['protocolVersion'])||_0x24cb75['protocolVersion']<=0x0||typeof _0x24cb75['startedAt']!='string'||Number[_0xd5bbc3(0x87)](Date['parse'](_0x24cb75[_0xd5bbc3(0xe2)])))throw z('DAEMON_CONTROL_INVALID_RESPONSE','Daemon\x20status\x20response\x20is\x20invalid');return{'identity':_0x24cb75[_0xd5bbc3(0x9f)],'pid':_0x24cb75[_0xd5bbc3(0x93)],'protocolVersion':_0x24cb75['protocolVersion'],'socketPath':_0xb7ba3f,'startedAt':_0x24cb75['startedAt'],'state':_0xd5bbc3(0xdc)};}async function F(_0x39dddd,_0x3bc429){const _0x4a0db6=_0x54e57c;let _0x21845d=Date[_0x4a0db6(0x81)]();for(;Date[_0x4a0db6(0x81)]()-_0x21845d<_0x3bc429;){if((await _0x39dddd())[_0x4a0db6(0xa2)]===_0x4a0db6(0x85))return;await new Promise(_0x2846cb=>setTimeout(_0x2846cb,k));}throw z(_0x4a0db6(0xea),_0x4a0db6(0xda)+String(_0x3bc429)+'ms');}function I(_0x53b299){const _0x2ef83c=_0x54e57c;return Object['assign'](Error(_0x2ef83c(0xcb)+_0x53b299),{'code':'ECONNREFUSED'});}function L(_0xe92b4d){const _0x5cc47d=_0x54e57c;return g(_0xe92b4d)||V(_0xe92b4d)&&(_0xe92b4d[_0x5cc47d(0x78)]===_0x5cc47d(0xd0)||_0xe92b4d[_0x5cc47d(0x78)]==='ECONNRESET'||_0xe92b4d[_0x5cc47d(0x78)]==='ENOTCONN'||_0xe92b4d[_0x5cc47d(0x78)]===_0x5cc47d(0xe7));}function R(_0x5dee20){const _0x4ba9f6=_0x54e57c;let _0x243d30=_0x5dee20 instanceof Error?_0x5dee20[_0x4ba9f6(0xc5)]:String(_0x5dee20);return V(_0x5dee20)&&typeof _0x5dee20['code']==_0x4ba9f6(0xa5)?{'code':_0x5dee20[_0x4ba9f6(0x78)],'message':_0x243d30}:{'message':_0x243d30};}function z(_0x4a5575,_0x35cb28){const _0x415207=_0x54e57c;return Object[_0x415207(0x83)](Error(_0x35cb28),{'code':_0x4a5575});}function B(_0x5d2e76,_0x48c9ce){const _0xf84965=_0x54e57c;if(!Number['isFinite'](_0x5d2e76)||_0x5d2e76<=0x0)throw Error(_0x48c9ce+_0xf84965(0x99));}function V(_0x223200){const _0x1ef3ed=_0x54e57c;return typeof _0x223200=='object'&&!!_0x223200&&!Array[_0x1ef3ed(0x90)](_0x223200);}function H(_0xdfaf3){let _0x4604d2=_0xdfaf3['requestTimeoutMs']??0x7530,_0x2d6b80=A(_0xdfaf3),_0x1ab9d2,_0x16b4a3=async()=>{const _0x279108=_0x4aa2;let _0x365700=await _0x2d6b80[_0x279108(0xe0)]();if(_0x365700[_0x279108(0xa2)]===_0x279108(0xdc))return _0x365700;if(_0x365700[_0x279108(0xa2)]!==_0x279108(0x85))throw N(_0x365700);let _0x4dc1b6=_0x1ab9d2??=_0x2d6b80[_0x279108(0xcc)]();try{return await _0x4dc1b6;}finally{_0x1ab9d2===_0x4dc1b6&&(_0x1ab9d2=void 0x0);}};return{async 'request'(_0x2cd7c3,_0x1bd4df){const _0x3ef80b=_0x4aa2;if(_0x2cd7c3[_0x3ef80b(0xc6)]===0x0)throw Error(_0x3ef80b(0x8e));await _0x16b4a3();try{return await m(_0xdfaf3[_0x3ef80b(0xb9)],_0x2cd7c3,_0x1bd4df,_0x4604d2);}catch(_0x4182ed){if(!g(_0x4182ed))throw _0x4182ed;}return await _0x16b4a3(),await m(_0xdfaf3['socketPath'],_0x2cd7c3,_0x1bd4df,_0x4604d2);}};}function U(_0x50cb12){const _0xf1dc1d=_0x54e57c;se(_0x50cb12[_0xf1dc1d(0xb9)]),x(_0x50cb12['identity']);let _0x3d4178=new Map(),_0x2b12fb=new Set(),_0x5f4202,_0x506168=!0x1,_0x1a4b49,_0x46ffff,_0x269f9={async 'close'(){_0x1a4b49??=_0x246650(),await _0x1a4b49;},'handle'(_0x51aa52,_0x2d46dc){const _0x5a453c=_0xf1dc1d;if(_0x506168)throw Error(_0x5a453c(0x91));if(_0x51aa52[_0x5a453c(0xc6)]===0x0)throw Error('Daemon\x20method\x20must\x20not\x20be\x20empty');if(D(_0x51aa52))throw Error('Daemon\x20method\x20namespace\x20is\x20reserved:\x20'+_0x51aa52);if(_0x3d4178['has'](_0x51aa52))throw Error(_0x5a453c(0xe9)+_0x51aa52+_0x5a453c(0x9d));_0x3d4178[_0x5a453c(0xcf)](_0x51aa52,_0x2d46dc);},async 'listen'(){const _0x36a1c9=_0xf1dc1d;if(!_0x506168){if(_0x1a4b49)throw Error(_0x36a1c9(0xdb));await _0x12a201(_0x16fba8(_0x50cb12['socketPath']),{'recursive':!0x0}),await X(_0x50cb12[_0x36a1c9(0xb9)]),_0x5f4202=_0x2fdfa0(_0x1a1875=>W(_0x1a1875,_0x3d4178,_0x2b12fb,{'shutdown':()=>{const _0x640613=_0x36a1c9;_0x269f9[_0x640613(0xe6)]()[_0x640613(0xc9)](()=>{const _0x3c926e=_0x640613;process[_0x3c926e(0x88)]=0x1;});},'status':()=>K(_0x50cb12['identity'],_0x50cb12[_0x36a1c9(0xb9)],_0x46ffff)})),await new Promise((_0x357e07,_0x4a5e76)=>{const _0x53fbaa=_0x36a1c9;let _0x5ecf26=_0x5f4202,_0x1c0ffd=_0x1b8bc7=>_0x4a5e76(oe(_0x1b8bc7)?Z(_0x50cb12['socketPath']):_0x1b8bc7);_0x5ecf26[_0x53fbaa(0x9a)](_0x53fbaa(0xc4),_0x1c0ffd),_0x5ecf26[_0x53fbaa(0x8a)](_0x50cb12[_0x53fbaa(0xb9)],()=>{const _0x161b48=_0x53fbaa;_0x5ecf26[_0x161b48(0xd1)](_0x161b48(0xc4),_0x1c0ffd),_0x506168=!0x0,_0x46ffff=new Date()['toISOString'](),_0x357e07();});});}}};return _0x269f9;async function _0x246650(){const _0x1008d8=_0xf1dc1d;for(let _0x5864d4 of _0x2b12fb)_0x5864d4['destroy']();_0x2b12fb[_0x1008d8(0xec)](),_0x5f4202&&_0x506168&&await new Promise((_0x3ae90c,_0x33d1b0)=>{const _0x403276=_0x1008d8;_0x5f4202[_0x403276(0xe6)](_0x1c427a=>_0x1c427a?_0x33d1b0(_0x1c427a):_0x3ae90c());}),_0x506168=!0x1;try{await _0x50cb12[_0x1008d8(0x86)]?.();}finally{await ie(_0x50cb12[_0x1008d8(0xb9)]);}}}function W(_0x1bcc6c,_0x19c60f,_0x5aa0de,_0x4f2e6e){const _0x2767e0=_0x54e57c;_0x5aa0de[_0x2767e0(0x7d)](_0x1bcc6c);let _0x27e2cb=!0x1,_0x18c1ad=d(_0x209c83=>{_0x27e2cb||(_0x27e2cb=!0x0,G(_0x1bcc6c,_0x209c83,_0x19c60f,_0x4f2e6e));});_0x1bcc6c['on']('data',_0x423d2b=>_0x18c1ad[_0x2767e0(0x7b)](_0x423d2b)),_0x1bcc6c['on'](_0x2767e0(0xb0),()=>_0x18c1ad[_0x2767e0(0xb0)]()),_0x1bcc6c['on']('close',()=>_0x5aa0de['delete'](_0x1bcc6c)),_0x1bcc6c['on'](_0x2767e0(0xc4),()=>_0x1bcc6c[_0x2767e0(0x73)]());}async function G(_0x3b9602,_0x4a391c,_0x24a2b8,_0x2e828c){const _0xb8b774=_0x54e57c;let _0x3baac8=_0xb8b774(0xb2),_0x44e087,_0x2209c7=!0x1;try{let _0x4dab08=q(_0x4a391c);_0x3baac8=_0x4dab08['id'];let _0x54e392;if(_0x4dab08[_0xb8b774(0x98)]===_0xb8b774(0xb6)){let _0x2d02e5=_0x2e828c[_0xb8b774(0xe0)]();_0x54e392={'identity':{..._0x2d02e5[_0xb8b774(0x9f)][_0xb8b774(0x71)]===void 0x0?{}:{'buildId':_0x2d02e5[_0xb8b774(0x9f)][_0xb8b774(0x71)]},'id':_0x2d02e5['identity']['id'],'version':_0x2d02e5[_0xb8b774(0x9f)][_0xb8b774(0x9c)]},'pid':_0x2d02e5['pid'],'protocolVersion':_0x2d02e5['protocolVersion'],'socketPath':_0x2d02e5['socketPath'],'startedAt':_0x2d02e5[_0xb8b774(0xe2)],'state':_0x2d02e5[_0xb8b774(0xa2)]};}else{if(_0x4dab08[_0xb8b774(0x98)]==='daemon.shutdown')_0x54e392=null,_0x2209c7=!0x0;else{let _0x2abdc0=_0x24a2b8['get'](_0x4dab08[_0xb8b774(0x98)]);if(!_0x2abdc0)throw Y('DAEMON_METHOD_NOT_FOUND','Unknown\x20daemon\x20method\x20'+_0x4dab08[_0xb8b774(0x98)]);_0x54e392=await _0x2abdc0(_0x4dab08[_0xb8b774(0xb8)]);}}_0x44e087={'id':_0x3baac8,'result':_0x54e392,'type':_0xb8b774(0xd4)};}catch(_0x28b70d){_0x44e087={'error':J(_0x28b70d),'id':_0x3baac8,'type':_0xb8b774(0xc4)};}_0x3b9602[_0xb8b774(0xb0)](u(_0x44e087),()=>{_0x2209c7&&_0x2e828c['shutdown']();});}function K(_0x188b6b,_0x5c88e3,_0x1af998){const _0x4cd0be=_0x54e57c;if(_0x1af998===void 0x0)throw Error(_0x4cd0be(0xbf));return{'identity':_0x188b6b,'pid':process[_0x4cd0be(0x93)],'protocolVersion':0x1,'socketPath':_0x5c88e3,'startedAt':_0x1af998,'state':_0x4cd0be(0xdc)};}function q(_0x1ea436){const _0xde7a48=_0x54e57c;let _0x59a1fa=JSON[_0xde7a48(0x7f)](_0x1ea436);if(!$(_0x59a1fa)||typeof _0x59a1fa['id']!=_0xde7a48(0xa5)||typeof _0x59a1fa[_0xde7a48(0x98)]!=_0xde7a48(0xa5)||!(_0xde7a48(0xb8)in _0x59a1fa))throw Y(_0xde7a48(0x94),_0xde7a48(0xe1));return _0x59a1fa;}function J(_0x300287){const _0x4335e0=_0x54e57c;if(_0x300287 instanceof Error){let _0x121608=_0x300287[_0x4335e0(0x78)];return{...typeof _0x121608==_0x4335e0(0xa5)?{'code':_0x121608}:{},'message':_0x300287[_0x4335e0(0xc5)],'name':_0x300287[_0x4335e0(0xba)]};}return{'message':String(_0x300287),'name':'Error'};}function Y(_0x5586c2,_0x5dfabb){const _0x4109a6=_0x54e57c;return Object[_0x4109a6(0x83)](Error(_0x5dfabb),{'code':_0x5586c2});}async function X(_0x543ad1){const _0xd7eab8=_0x54e57c;try{if(!(await _0x4889f6(_0x543ad1))[_0xd7eab8(0x75)]())throw Error(_0xd7eab8(0xdd)+_0x543ad1);if(await re(_0x543ad1))throw Z(_0x543ad1);await _0x4c125a(_0x543ad1);}catch(_0x50a90e){if(Q(_0x50a90e))return;throw _0x50a90e;}}function re(_0x13efc0){return new Promise((_0x10897a,_0x2380aa)=>{const _0x3409d5=_0x4aa2;let _0x295448=_0x3170d1(_0x13efc0);_0x295448['once'](_0x3409d5(0x70),()=>{const _0x526012=_0x3409d5;_0x295448[_0x526012(0x73)](),_0x10897a(!0x0);}),_0x295448[_0x3409d5(0x9a)](_0x3409d5(0xc4),_0x5a9a56=>{const _0x4ef97f=_0x3409d5;_0x295448[_0x4ef97f(0x73)](),ae(_0x5a9a56)||Q(_0x5a9a56)?_0x10897a(!0x1):_0x2380aa(_0x5a9a56);});});}function Z(_0x2d0dc5){const _0x5e6aef=_0x54e57c;return Object[_0x5e6aef(0x83)](Error(_0x5e6aef(0xc2)+_0x2d0dc5),{'code':'DAEMON_ALREADY_RUNNING'});}async function ie(_0x106b4b){const _0x5ef4a2=_0x54e57c;try{(await _0x4889f6(_0x106b4b))[_0x5ef4a2(0x75)]()&&await _0x4c125a(_0x106b4b);}catch(_0x1e1bad){if(!Q(_0x1e1bad))throw _0x1e1bad;}}function Q(_0x1b2b82){const _0x55b387=_0x54e57c;return $(_0x1b2b82)&&_0x1b2b82[_0x55b387(0x78)]===_0x55b387(0x89);}function ae(_0x45e555){const _0x5efdaf=_0x54e57c;return $(_0x45e555)&&_0x45e555[_0x5efdaf(0x78)]===_0x5efdaf(0xc7);}function oe(_0x3c27d2){const _0x18744d=_0x54e57c;return $(_0x3c27d2)&&_0x3c27d2[_0x18744d(0x78)]==='EADDRINUSE';}function se(_0x1d19a1){const _0x2c2b3d=_0x54e57c;if(_0x1d19a1[_0x2c2b3d(0xc6)]===0x0)throw Error(_0x2c2b3d(0xb4));}function $(_0x1682c6){const _0x48ec0c=_0x54e57c;return typeof _0x1682c6==_0x48ec0c(0xd2)&&!!_0x1682c6&&!Array[_0x48ec0c(0x90)](_0x1682c6);}export{w as DAEMON_PROTOCOL_VERSION,E as DAEMON_SHUTDOWN_METHOD,f as DAEMON_SOCKET_ENV,T as DAEMON_STATUS_METHOD,H as createDaemonClient,A as createDaemonControl,U as createDaemonServer};
|
|
1
|
+
const _0x13b489=_0x1f66;(function(_0x2c22c2,_0x52751f){const _0x2b03f3=_0x1f66,_0x32f4dc=_0x2c22c2();while(!![]){try{const _0x46d13c=parseInt(_0x2b03f3(0x18d))/0x1+-parseInt(_0x2b03f3(0x1d5))/0x2*(-parseInt(_0x2b03f3(0x18a))/0x3)+parseInt(_0x2b03f3(0x176))/0x4*(parseInt(_0x2b03f3(0x1d1))/0x5)+parseInt(_0x2b03f3(0x1c2))/0x6*(parseInt(_0x2b03f3(0x179))/0x7)+-parseInt(_0x2b03f3(0x18c))/0x8*(-parseInt(_0x2b03f3(0x1e6))/0x9)+parseInt(_0x2b03f3(0x1a3))/0xa*(-parseInt(_0x2b03f3(0x1a4))/0xb)+-parseInt(_0x2b03f3(0x1a6))/0xc;if(_0x46d13c===_0x52751f)break;else _0x32f4dc['push'](_0x32f4dc['shift']());}catch(_0xd8726b){_0x32f4dc['push'](_0x32f4dc['shift']());}}}(_0x150f,0x9f0b7));import{randomUUID as _0x4f765e}from'node:crypto';import{spawn as _0x32cb9f}from'node:child_process';import{connect as _0x3d54f0,createServer as _0x4561aa}from'node:net';import{fileURLToPath as _0x2dd39b}from'node:url';import{StringDecoder as _0x19654a}from'node:string_decoder';function _0x150f(){const _0x3dec29=['utf8','reason','Daemon\x20did\x20not\x20start\x20within\x20','stopTimeoutMs','protocol','isSafeInteger','legacy-protocol','DAEMON_ALREADY_RUNNING','startsWith','DAEMON_CONTROL_INVALID_RESPONSE','code','A\x20daemon\x20is\x20already\x20listening\x20on\x20','Unknown\x20daemon\x20method\x20','has','execPath','3333570ZIwVmQ','buildId','build-id-mismatch','socketPath','Invalid\x20daemon\x20request','isNaN','DAEMON_CONNECTION_CLOSED','ENOENT','EADDRINUSE','ready','write','off','error','\x20is\x20already\x20registered','shutdown','19795VThQFj','protocolVersion','running','exitCode','604FGFswl','href','invalid-health','status','UNIVER_CLI_SDK_DAEMON_SOCKET','connect','Daemon\x20server\x20has\x20not\x20started\x20listening','version-mismatch','DAEMON_INCOMPATIBLE','options','file:','Daemon\x20method\x20must\x20not\x20be\x20empty','Daemon\x20status\x20response\x20is\x20invalid','diagnostic','stringify','set','pid','18QyiVUo','end','ENOTCONN','Daemon\x20is\x20not\x20ready:\x20','data','win32','ECONNREFUSED','trim','payload','isSocket','platform','number','version','startedAt','1140qwYFvR','Daemon\x20handlers\x20must\x20be\x20registered\x20before\x20listen()','push','14jQgODQ','Invalid\x20daemon\x20response','catch','Daemon\x20entry\x20must\x20be\x20an\x20absolute\x20file\x20URL','DAEMON_INVALID_REQUEST','\x20must\x20be\x20a\x20finite\x20positive\x20number','close','length','indexOf','destroy','DAEMON_STOP_TIMEOUT','unref','identity','startTimeoutMs','object','parse','assign','11931JJJPob','env','2164264rTdLvT','1115977dQFlDn','incompatible','once','get','entry','delete','DAEMON_REQUEST_TIMEOUT','message','DAEMON_METHOD_NOT_FOUND','name','socketPath\x20must\x20not\x20be\x20empty','stopped','daemon.status','isArray','result','listen','ECONNRESET','type','daemon.shutdown','Daemon\x20method\x20','unreachable','now','90NBcpSD','1424027UnibTy','state','39372504bsvyIx','requestTimeoutMs','Error','Daemon\x20connection\x20closed\x20before\x20a\x20response\x20was\x20received','Daemon\x20method\x20namespace\x20is\x20reserved:\x20','timeoutMs','identity.id','unknown','slice','DAEMON_START_TIMEOUT','string','method','daemon.'];_0x150f=function(){return _0x3dec29;};return _0x150f();}import{lstat as _0xb08d28,mkdir as _0x2a6f86,unlink as _0x308563}from'node:fs/promises';import{dirname as _0x231bf1}from'node:path';function u(_0x3b5240){const _0x18eba2=_0x1f66;return JSON[_0x18eba2(0x1e3)](_0x3b5240)+'\x0a';}function d(_0x211894){const _0x245e28=_0x1f66;let _0x51f277='',_0x1c7640=new _0x19654a(_0x245e28(0x1b3));return{'end'(){const _0x5c650d=_0x245e28;_0x51f277+=_0x1c7640[_0x5c650d(0x1e7)](),_0x51f277['trim']()[_0x5c650d(0x180)]>0x0&&_0x211894(_0x51f277),_0x51f277='';},'push'(_0x94a72e){const _0x2e6011=_0x245e28;for(_0x51f277+=_0x1c7640[_0x2e6011(0x1cc)](_0x94a72e);;){let _0x371cdc=_0x51f277[_0x2e6011(0x181)]('\x0a');if(_0x371cdc<0x0)return;let _0x3a7c1b=_0x51f277[_0x2e6011(0x1ae)](0x0,_0x371cdc);_0x51f277=_0x51f277['slice'](_0x371cdc+0x1),_0x3a7c1b[_0x2e6011(0x1ed)]()[_0x2e6011(0x180)]>0x0&&_0x211894(_0x3a7c1b);}}};}var f=_0x13b489(0x1d9);async function p(_0x5ca48a){const _0x3a4213=_0x13b489;_0x32cb9f(process[_0x3a4213(0x1c1)],[_0x2dd39b(_0x5ca48a[_0x3a4213(0x191)])],{'detached':!0x0,'env':{...process.env,..._0x5ca48a[_0x3a4213(0x1de)][_0x3a4213(0x18b)],[f]:_0x5ca48a[_0x3a4213(0x1de)][_0x3a4213(0x1c5)]},'stdio':'ignore'})[_0x3a4213(0x184)]();let _0x466396=Date[_0x3a4213(0x1a2)]();for(;Date['now']()-_0x466396<_0x5ca48a['timeoutMs'];){try{return await _0x5ca48a[_0x3a4213(0x1cb)]();}catch(_0x65ea85){if(!g(_0x65ea85))throw _0x65ea85;}await new Promise(_0x1be74c=>setTimeout(_0x1be74c,0x19));}throw Object[_0x3a4213(0x189)](Error(_0x3a4213(0x1b5)+String(_0x5ca48a[_0x3a4213(0x1ab)])+'ms'),{'code':_0x3a4213(0x1af)});}function m(_0x37918d,_0x2179f5,_0xec303,_0x2ab859){return new Promise((_0x42704b,_0x58e825)=>{const _0x2f8c28=_0x1f66;let _0x5358e1=_0x3d54f0(_0x37918d),_0x59968b=_0x4f765e(),_0x19c364=!0x1,_0x2e19eb=setTimeout(()=>{const _0xbbdee9=_0x1f66;_0x5358e1[_0xbbdee9(0x182)](),_0x58e825(Object['assign'](Error('Daemon\x20request\x20timed\x20out\x20after\x20'+String(_0x2ab859)+'ms'),{'code':_0xbbdee9(0x193)}));},_0x2ab859),_0x2701ca=_0x1f2cbb=>{_0x19c364||(_0x19c364=!0x0,clearTimeout(_0x2e19eb),_0x1f2cbb());},_0x2bea87=d(_0x89680f=>{try{let _0x5b6061=v(_0x89680f,_0x59968b);_0x2701ca(()=>{const _0x17590b=_0x1f66;_0x5358e1['end'](),_0x5b6061['type']==='error'?_0x58e825(y(_0x5b6061['error'])):_0x42704b(_0x5b6061[_0x17590b(0x19b)]);});}catch(_0x1dbe64){_0x2701ca(()=>{const _0x2bdbc0=_0x1f66;_0x5358e1[_0x2bdbc0(0x182)](),_0x58e825(_0x1dbe64);});}});_0x5358e1[_0x2f8c28(0x18f)](_0x2f8c28(0x1ce),_0x4b5cdf=>_0x2701ca(()=>{_0x5358e1['destroy'](),_0x58e825(_0x4b5cdf);})),_0x5358e1['on'](_0x2f8c28(0x1ea),_0x3a0f98=>_0x2bea87[_0x2f8c28(0x178)](_0x3a0f98)),_0x5358e1['on']('end',()=>{const _0xa5eb8d=_0x2f8c28;_0x2bea87[_0xa5eb8d(0x1e7)](),_0x2701ca(()=>{const _0x1fd322=_0xa5eb8d;_0x5358e1[_0x1fd322(0x182)](),_0x58e825(_());});}),_0x5358e1['on'](_0x2f8c28(0x17f),()=>_0x2701ca(()=>{const _0x61b4cb=_0x2f8c28;_0x5358e1[_0x61b4cb(0x182)](),_0x58e825(_());})),_0x5358e1[_0x2f8c28(0x18f)](_0x2f8c28(0x1da),()=>{_0x5358e1['write'](u({'id':_0x59968b,'method':_0x2179f5,'payload':_0xec303}));});});}function h(_0x1a0907){const _0x36b490=_0x13b489;let _0x37f900=_0x1a0907 instanceof URL?_0x1a0907[_0x36b490(0x1d6)]:_0x1a0907;try{let _0x14050d=new URL(_0x37f900);if(_0x14050d[_0x36b490(0x1b7)]!==_0x36b490(0x1df))throw Error();return _0x14050d[_0x36b490(0x1d6)];}catch{throw Error(_0x36b490(0x17c));}}function g(_0x5ddc2c){const _0xa244d2=_0x13b489;return b(_0x5ddc2c)?_0x5ddc2c[_0xa244d2(0x1bd)]==='ENOENT'||_0x5ddc2c[_0xa244d2(0x1bd)]===_0xa244d2(0x1ec):!0x1;}function _(){const _0x2682a1=_0x13b489;return Object[_0x2682a1(0x189)](Error(_0x2682a1(0x1a9)),{'code':_0x2682a1(0x1c8)});}function v(_0x5e2098,_0x42ea99){const _0x3757ed=_0x13b489;let _0x3aa6b8=JSON[_0x3757ed(0x188)](_0x5e2098);if(!b(_0x3aa6b8)||_0x3aa6b8['id']!==_0x42ea99)throw Error(_0x3757ed(0x17a));if(_0x3aa6b8['type']===_0x3757ed(0x19b)&&_0x3757ed(0x19b)in _0x3aa6b8||_0x3aa6b8[_0x3757ed(0x19e)]===_0x3757ed(0x1ce)&&b(_0x3aa6b8['error']))return _0x3aa6b8;throw Error(_0x3757ed(0x17a));}function y(_0x106e4f){const _0x303c82=_0x13b489;let _0x1d38e4=Error(_0x106e4f[_0x303c82(0x194)]);return _0x106e4f[_0x303c82(0x1bd)]!==void 0x0&&Object['assign'](_0x1d38e4,{'code':_0x106e4f['code']}),_0x1d38e4[_0x303c82(0x196)]=_0x106e4f[_0x303c82(0x196)],_0x1d38e4;}function b(_0x30ab7b){const _0x4d42a6=_0x13b489;return typeof _0x30ab7b==_0x4d42a6(0x187)&&!!_0x30ab7b&&!Array[_0x4d42a6(0x19a)](_0x30ab7b);}function x(_0x1e2000){const _0x33fbbd=_0x13b489;C(_0x1e2000['id'],_0x33fbbd(0x1ac)),C(_0x1e2000[_0x33fbbd(0x174)],'identity.version'),_0x1e2000['buildId']!==void 0x0&&C(_0x1e2000[_0x33fbbd(0x1c3)],'identity.buildId');}function S(_0x3dfd03){const _0x287547=_0x13b489;return ee(_0x3dfd03)&&typeof _0x3dfd03['id']=='string'&&_0x3dfd03['id'][_0x287547(0x180)]>0x0&&typeof _0x3dfd03[_0x287547(0x174)]==_0x287547(0x1b0)&&_0x3dfd03['version'][_0x287547(0x180)]>0x0&&(_0x3dfd03['buildId']===void 0x0||typeof _0x3dfd03[_0x287547(0x1c3)]==_0x287547(0x1b0)&&_0x3dfd03[_0x287547(0x1c3)][_0x287547(0x180)]>0x0);}function C(_0x57973f,_0x27f38d){const _0x9bb64a=_0x13b489;if(_0x57973f[_0x9bb64a(0x180)]===0x0)throw Error(_0x27f38d+'\x20must\x20not\x20be\x20empty');}function ee(_0x5c3820){const _0x3721bc=_0x13b489;return typeof _0x5c3820=='object'&&!!_0x5c3820&&!Array[_0x3721bc(0x19a)](_0x5c3820);}var te=0x1,w=_0x13b489(0x199),T='daemon.shutdown';function E(_0x6b93f3){const _0x92cb5e=_0x13b489;return _0x6b93f3[_0x92cb5e(0x1bb)](_0x92cb5e(0x1b2));}var D=0x2710,O=0x19;function k(_0x536790){const _0x5a4461=_0x13b489;x(_0x536790[_0x5a4461(0x185)]);let _0x3aa84c=h(_0x536790['entry']),_0x44f725=_0x536790[_0x5a4461(0x1a7)]??0x7530,_0x64b0e2=_0x536790[_0x5a4461(0x186)]??0x2710,_0x29a374=_0x536790[_0x5a4461(0x1b6)]??D;z(_0x44f725,_0x5a4461(0x1a7)),z(_0x64b0e2,_0x5a4461(0x186)),z(_0x29a374,_0x5a4461(0x1b6));let _0x1457ae=()=>({'socketPath':_0x536790[_0x5a4461(0x1c5)],'state':'stopped'}),_0x21b0b4=async()=>{const _0x17521e=_0x5a4461;try{let _0x588cbe=N(await m(_0x536790[_0x17521e(0x1c5)],w,null,_0x44f725),_0x536790[_0x17521e(0x1c5)]),_0x5210c2=ne(_0x536790['identity'],_0x588cbe);return _0x5210c2===void 0x0?_0x588cbe:re(_0x536790[_0x17521e(0x185)],_0x588cbe,_0x5210c2,_0x536790[_0x17521e(0x1c5)]);}catch(_0x211b4d){if(g(_0x211b4d))return _0x1457ae();let _0xafdf8c=L(_0x211b4d);return _0xafdf8c['code']===_0x17521e(0x195)?j(_0x536790[_0x17521e(0x185)],_0x17521e(0x1b9),_0x536790[_0x17521e(0x1c5)],_0xafdf8c):_0xafdf8c[_0x17521e(0x1bd)]===_0x17521e(0x1bc)?j(_0x536790[_0x17521e(0x185)],_0x17521e(0x1d7),_0x536790['socketPath'],_0xafdf8c):{'diagnostic':_0xafdf8c,'socketPath':_0x536790[_0x17521e(0x1c5)],'state':_0x17521e(0x1a1)};}},_0xa34b89=async()=>{const _0x178fc4=_0x5a4461;let _0x3a8667=await _0x21b0b4();if(_0x3a8667['state']===_0x178fc4(0x1d3))return{..._0x3a8667,'started':!0x1};if(_0x3a8667[_0x178fc4(0x1a5)]!=='stopped')throw M(_0x3a8667);return{...await p({'entry':_0x3aa84c,'options':_0x536790,'ready':async()=>{const _0x5807c6=_0x178fc4;let _0x2be8ee=await _0x21b0b4();if(_0x2be8ee[_0x5807c6(0x1a5)]===_0x5807c6(0x198))throw F(_0x536790[_0x5807c6(0x1c5)]);if(_0x2be8ee[_0x5807c6(0x1a5)]!==_0x5807c6(0x1d3))throw M(_0x2be8ee);return _0x2be8ee;},'timeoutMs':_0x64b0e2}),'started':!0x0};},_0x257141=async()=>{const _0x45f20b=_0x5a4461;let _0x5d6db9=await _0x21b0b4();if(_0x5d6db9[_0x45f20b(0x1a5)]===_0x45f20b(0x198))return{..._0x5d6db9,'stopped':!0x1};if(_0x5d6db9['state']!==_0x45f20b(0x1d3)&&!A(_0x5d6db9))throw M(_0x5d6db9);try{await m(_0x536790[_0x45f20b(0x1c5)],T,null,_0x44f725);}catch(_0x12fd3f){if(!I(_0x12fd3f))throw _0x12fd3f;}return await P(_0x21b0b4,_0x29a374),{..._0x1457ae(),'stopped':!0x0};};return{async 'restart'(){const _0x3f64f1=_0x5a4461;let _0x5d9df6=await _0x21b0b4();if(_0x5d9df6[_0x3f64f1(0x1a5)]!=='running'&&_0x5d9df6[_0x3f64f1(0x1a5)]!=='stopped'&&!A(_0x5d9df6))throw M(_0x5d9df6);(_0x5d9df6[_0x3f64f1(0x1a5)]===_0x3f64f1(0x1d3)||A(_0x5d9df6))&&await _0x257141();let _0x41e6fc=await _0xa34b89(),_0x79c2f9=_0x5d9df6[_0x3f64f1(0x1a5)]==='running'?_0x5d9df6[_0x3f64f1(0x1e5)]:A(_0x5d9df6)?_0x5d9df6['actual']['pid']:void 0x0;return{'identity':_0x41e6fc[_0x3f64f1(0x185)],'pid':_0x41e6fc[_0x3f64f1(0x1e5)],..._0x79c2f9===void 0x0?{}:{'previousPid':_0x79c2f9},'restarted':_0x5d9df6[_0x3f64f1(0x1a5)]!==_0x3f64f1(0x198),'protocolVersion':_0x41e6fc['protocolVersion'],'socketPath':_0x41e6fc[_0x3f64f1(0x1c5)],'startedAt':_0x41e6fc[_0x3f64f1(0x175)],'state':_0x3f64f1(0x1d3)};},'start':_0xa34b89,'status':_0x21b0b4,'stop':_0x257141};}function A(_0x4463b6){const _0x31a8c0=_0x13b489;return _0x4463b6['state']===_0x31a8c0(0x18e)&&_0x4463b6['actual']!==void 0x0&&(_0x4463b6['reason']===_0x31a8c0(0x1dc)||_0x4463b6[_0x31a8c0(0x1b4)]===_0x31a8c0(0x1c4));}function _0x1f66(_0x3b0f63,_0x89060b){_0x3b0f63=_0x3b0f63-0x173;const _0x150fda=_0x150f();let _0x1f66b8=_0x150fda[_0x3b0f63];return _0x1f66b8;}function ne(_0x4dc48c,_0x278d2b){const _0x2579e3=_0x13b489;if(_0x278d2b[_0x2579e3(0x1d2)]!==0x1)return'protocol-mismatch';if(_0x278d2b[_0x2579e3(0x185)]['id']!==_0x4dc48c['id'])return'identity-mismatch';if(_0x278d2b['identity'][_0x2579e3(0x174)]!==_0x4dc48c[_0x2579e3(0x174)])return _0x2579e3(0x1dc);if(_0x4dc48c[_0x2579e3(0x1c3)]!==void 0x0&&_0x278d2b[_0x2579e3(0x185)]['buildId']!==_0x4dc48c[_0x2579e3(0x1c3)])return _0x2579e3(0x1c4);}function re(_0x599ed6,_0x5393a7,_0x55ced4,_0x2646f7){const _0x3e1d4a=_0x13b489;return{'actual':{'identity':_0x5393a7[_0x3e1d4a(0x185)],'pid':_0x5393a7[_0x3e1d4a(0x1e5)],'protocolVersion':_0x5393a7[_0x3e1d4a(0x1d2)],'socketPath':_0x5393a7[_0x3e1d4a(0x1c5)],'startedAt':_0x5393a7[_0x3e1d4a(0x175)]},'expected':{'identity':_0x599ed6,'protocolVersion':0x1},'reason':_0x55ced4,'socketPath':_0x2646f7,'state':_0x3e1d4a(0x18e)};}function j(_0x5703a6,_0x38fdf4,_0x594f90,_0x4e8479){const _0x2eb4f5=_0x13b489;return{'diagnostic':_0x4e8479,'expected':{'identity':_0x5703a6,'protocolVersion':0x1},'reason':_0x38fdf4,'socketPath':_0x594f90,'state':_0x2eb4f5(0x18e)};}function M(_0x59757b){const _0x43c0c0=_0x13b489;let _0x2679b8=_0x59757b[_0x43c0c0(0x1a5)]===_0x43c0c0(0x18e)?_0x59757b[_0x43c0c0(0x1b4)]:_0x59757b[_0x43c0c0(0x1e2)][_0x43c0c0(0x194)];return R(_0x59757b[_0x43c0c0(0x1a5)]===_0x43c0c0(0x18e)?_0x43c0c0(0x1dd):'DAEMON_UNREACHABLE',_0x43c0c0(0x1e9)+_0x2679b8);}function N(_0x183a87,_0x3357dd){const _0x13ce81=_0x13b489;if(!B(_0x183a87)||_0x183a87[_0x13ce81(0x1a5)]!==_0x13ce81(0x1d3)||_0x183a87[_0x13ce81(0x1c5)]!==_0x3357dd||!S(_0x183a87[_0x13ce81(0x185)])||typeof _0x183a87[_0x13ce81(0x1e5)]!=_0x13ce81(0x173)||!Number[_0x13ce81(0x1b8)](_0x183a87[_0x13ce81(0x1e5)])||_0x183a87['pid']<=0x0||typeof _0x183a87[_0x13ce81(0x1d2)]!=_0x13ce81(0x173)||!Number[_0x13ce81(0x1b8)](_0x183a87[_0x13ce81(0x1d2)])||_0x183a87[_0x13ce81(0x1d2)]<=0x0||typeof _0x183a87[_0x13ce81(0x175)]!=_0x13ce81(0x1b0)||Number[_0x13ce81(0x1c7)](Date[_0x13ce81(0x188)](_0x183a87[_0x13ce81(0x175)])))throw R('DAEMON_CONTROL_INVALID_RESPONSE',_0x13ce81(0x1e1));return{'identity':_0x183a87[_0x13ce81(0x185)],'pid':_0x183a87[_0x13ce81(0x1e5)],'protocolVersion':_0x183a87[_0x13ce81(0x1d2)],'socketPath':_0x3357dd,'startedAt':_0x183a87[_0x13ce81(0x175)],'state':'running'};}async function P(_0xe8c9b0,_0x5472b8){const _0x21488d=_0x13b489;let _0x5d6720=Date[_0x21488d(0x1a2)]();for(;Date['now']()-_0x5d6720<_0x5472b8;){if((await _0xe8c9b0())[_0x21488d(0x1a5)]===_0x21488d(0x198))return;await new Promise(_0x4d68fc=>setTimeout(_0x4d68fc,O));}throw R(_0x21488d(0x183),'Daemon\x20did\x20not\x20stop\x20within\x20'+String(_0x5472b8)+'ms');}function F(_0x5cf43b){return Object['assign'](Error('Daemon\x20is\x20not\x20listening\x20on\x20'+_0x5cf43b),{'code':'ECONNREFUSED'});}function I(_0x2443d2){const _0x543b60=_0x13b489;return g(_0x2443d2)||B(_0x2443d2)&&(_0x2443d2[_0x543b60(0x1bd)]===_0x543b60(0x1c8)||_0x2443d2[_0x543b60(0x1bd)]===_0x543b60(0x19d)||_0x2443d2[_0x543b60(0x1bd)]===_0x543b60(0x1e8)||_0x2443d2[_0x543b60(0x1bd)]==='EPIPE');}function L(_0x5a5593){const _0x55f580=_0x13b489;let _0x3186fe=_0x5a5593 instanceof Error?_0x5a5593[_0x55f580(0x194)]:String(_0x5a5593);return B(_0x5a5593)&&typeof _0x5a5593[_0x55f580(0x1bd)]==_0x55f580(0x1b0)?{'code':_0x5a5593['code'],'message':_0x3186fe}:{'message':_0x3186fe};}function R(_0x2b2644,_0x142cdf){const _0x4c6140=_0x13b489;return Object[_0x4c6140(0x189)](Error(_0x142cdf),{'code':_0x2b2644});}function z(_0x12ea51,_0x2115f4){const _0x2697ca=_0x13b489;if(!Number['isFinite'](_0x12ea51)||_0x12ea51<=0x0)throw Error(_0x2115f4+_0x2697ca(0x17e));}function B(_0xac3f50){const _0x5d371b=_0x13b489;return typeof _0xac3f50==_0x5d371b(0x187)&&!!_0xac3f50&&!Array[_0x5d371b(0x19a)](_0xac3f50);}function V(_0xb414ae){const _0x45d97b=_0x13b489;let _0x126733=_0xb414ae[_0x45d97b(0x1a7)]??0x7530,_0xeed19d=k(_0xb414ae),_0x12a021,_0x58f543=async()=>{const _0x5be7c8=_0x45d97b;let _0xc48a08=await _0xeed19d[_0x5be7c8(0x1d8)]();if(_0xc48a08['state']===_0x5be7c8(0x1d3))return _0xc48a08;if(_0xc48a08[_0x5be7c8(0x1a5)]!==_0x5be7c8(0x198))throw M(_0xc48a08);let _0x23965c=_0x12a021??=_0xeed19d['start']();try{return await _0x23965c;}finally{_0x12a021===_0x23965c&&(_0x12a021=void 0x0);}};return{async 'request'(_0x60d01e,_0x55156c){const _0x7a75de=_0x45d97b;if(_0x60d01e['length']===0x0)throw Error(_0x7a75de(0x1e0));await _0x58f543();try{return await m(_0xb414ae[_0x7a75de(0x1c5)],_0x60d01e,_0x55156c,_0x126733);}catch(_0x1e9fe7){if(!g(_0x1e9fe7))throw _0x1e9fe7;}return await _0x58f543(),await m(_0xb414ae[_0x7a75de(0x1c5)],_0x60d01e,_0x55156c,_0x126733);}};}function H(_0x4a4227){const _0x18ec89=_0x13b489;se(_0x4a4227['socketPath']),x(_0x4a4227[_0x18ec89(0x185)]);let _0xe1fb15=new Map(),_0x389c0b=new Set(),_0x51d434,_0x511f31=!0x1,_0x49b527,_0x336eb8,_0x4e990a={async 'close'(){_0x49b527??=_0x3f388f(),await _0x49b527;},'handle'(_0x39ffca,_0x488066){const _0xdc692f=_0x18ec89;if(_0x511f31)throw Error(_0xdc692f(0x177));if(_0x39ffca[_0xdc692f(0x180)]===0x0)throw Error(_0xdc692f(0x1e0));if(E(_0x39ffca))throw Error(_0xdc692f(0x1aa)+_0x39ffca);if(_0xe1fb15[_0xdc692f(0x1c0)](_0x39ffca))throw Error(_0xdc692f(0x1a0)+_0x39ffca+_0xdc692f(0x1cf));_0xe1fb15[_0xdc692f(0x1e4)](_0x39ffca,_0x488066);},async 'listen'(){const _0x90abbf=_0x18ec89;if(!_0x511f31){if(_0x49b527)throw Error('Daemon\x20server\x20is\x20closed');process[_0x90abbf(0x1f0)]!=='win32'&&await _0x2a6f86(_0x231bf1(_0x4a4227['socketPath']),{'recursive':!0x0}),await Y(_0x4a4227[_0x90abbf(0x1c5)]),_0x51d434=_0x4561aa(_0xfba260=>U(_0xfba260,_0xe1fb15,_0x389c0b,{'shutdown':()=>{const _0x575859=_0x90abbf;_0x4e990a[_0x575859(0x17f)]()[_0x575859(0x17b)](()=>{const _0x54bdd9=_0x575859;process[_0x54bdd9(0x1d4)]=0x1;});},'status':()=>G(_0x4a4227[_0x90abbf(0x185)],_0x4a4227[_0x90abbf(0x1c5)],_0x336eb8)})),await new Promise((_0x32dacc,_0x45a62f)=>{const _0x17bcec=_0x90abbf;let _0x52f55f=_0x51d434,_0x2d1aa1=_0x2ef148=>_0x45a62f(oe(_0x2ef148)?Z(_0x4a4227[_0x17bcec(0x1c5)]):_0x2ef148);_0x52f55f[_0x17bcec(0x18f)](_0x17bcec(0x1ce),_0x2d1aa1),_0x52f55f[_0x17bcec(0x19c)](_0x4a4227[_0x17bcec(0x1c5)],()=>{const _0x16b9d7=_0x17bcec;_0x52f55f[_0x16b9d7(0x1cd)](_0x16b9d7(0x1ce),_0x2d1aa1),_0x511f31=!0x0,_0x336eb8=new Date()['toISOString'](),_0x32dacc();});});}}};return _0x4e990a;async function _0x3f388f(){const _0x21eb56=_0x18ec89;for(let _0x684b4 of _0x389c0b)_0x684b4[_0x21eb56(0x182)]();_0x389c0b['clear'](),_0x51d434&&_0x511f31&&await new Promise((_0x54354e,_0x19a647)=>{const _0x476706=_0x21eb56;_0x51d434[_0x476706(0x17f)](_0xe5eb1e=>_0xe5eb1e?_0x19a647(_0xe5eb1e):_0x54354e());}),_0x511f31=!0x1;try{await _0x4a4227['onShutdown']?.();}finally{await ie(_0x4a4227[_0x21eb56(0x1c5)]);}}}function U(_0x11e673,_0x352545,_0x4c72bb,_0x43e141){const _0xde97eb=_0x13b489;_0x4c72bb['add'](_0x11e673);let _0x43246c=!0x1,_0xbc27c=d(_0x47f425=>{_0x43246c||(_0x43246c=!0x0,W(_0x11e673,_0x47f425,_0x352545,_0x43e141));});_0x11e673['on'](_0xde97eb(0x1ea),_0x12fa75=>_0xbc27c[_0xde97eb(0x178)](_0x12fa75)),_0x11e673['on'](_0xde97eb(0x1e7),()=>_0xbc27c[_0xde97eb(0x1e7)]()),_0x11e673['on'](_0xde97eb(0x17f),()=>_0x4c72bb[_0xde97eb(0x192)](_0x11e673)),_0x11e673['on'](_0xde97eb(0x1ce),()=>_0x11e673[_0xde97eb(0x182)]());}async function W(_0x2c79e0,_0x66d5b0,_0x5bd5c6,_0x2e69a0){const _0x34c67f=_0x13b489;let _0x3a03fc=_0x34c67f(0x1ad),_0xad94b5,_0x281456=!0x1;try{let _0x38cfae=K(_0x66d5b0);_0x3a03fc=_0x38cfae['id'];let _0x580be0;if(_0x38cfae['method']===_0x34c67f(0x199)){let _0x597b55=_0x2e69a0[_0x34c67f(0x1d8)]();_0x580be0={'identity':{..._0x597b55[_0x34c67f(0x185)][_0x34c67f(0x1c3)]===void 0x0?{}:{'buildId':_0x597b55['identity'][_0x34c67f(0x1c3)]},'id':_0x597b55[_0x34c67f(0x185)]['id'],'version':_0x597b55[_0x34c67f(0x185)][_0x34c67f(0x174)]},'pid':_0x597b55[_0x34c67f(0x1e5)],'protocolVersion':_0x597b55[_0x34c67f(0x1d2)],'socketPath':_0x597b55[_0x34c67f(0x1c5)],'startedAt':_0x597b55[_0x34c67f(0x175)],'state':_0x597b55['state']};}else{if(_0x38cfae[_0x34c67f(0x1b1)]===_0x34c67f(0x19f))_0x580be0=null,_0x281456=!0x0;else{let _0x57694e=_0x5bd5c6[_0x34c67f(0x190)](_0x38cfae[_0x34c67f(0x1b1)]);if(!_0x57694e)throw J('DAEMON_METHOD_NOT_FOUND',_0x34c67f(0x1bf)+_0x38cfae[_0x34c67f(0x1b1)]);_0x580be0=await _0x57694e(_0x38cfae[_0x34c67f(0x1ee)]);}}_0xad94b5={'id':_0x3a03fc,'result':_0x580be0,'type':_0x34c67f(0x19b)};}catch(_0x5c5d27){_0xad94b5={'error':q(_0x5c5d27),'id':_0x3a03fc,'type':_0x34c67f(0x1ce)};}_0x2c79e0['end'](u(_0xad94b5),()=>{const _0x408081=_0x34c67f;_0x281456&&_0x2e69a0[_0x408081(0x1d0)]();});}function G(_0x4c746b,_0x1befdb,_0x29349b){const _0x431096=_0x13b489;if(_0x29349b===void 0x0)throw Error(_0x431096(0x1db));return{'identity':_0x4c746b,'pid':process[_0x431096(0x1e5)],'protocolVersion':0x1,'socketPath':_0x1befdb,'startedAt':_0x29349b,'state':_0x431096(0x1d3)};}function K(_0x4d55d7){const _0x22546f=_0x13b489;let _0x149abf=JSON[_0x22546f(0x188)](_0x4d55d7);if(!$(_0x149abf)||typeof _0x149abf['id']!=_0x22546f(0x1b0)||typeof _0x149abf[_0x22546f(0x1b1)]!=_0x22546f(0x1b0)||!(_0x22546f(0x1ee)in _0x149abf))throw J(_0x22546f(0x17d),_0x22546f(0x1c6));return _0x149abf;}function q(_0x25b69c){const _0x2da3f8=_0x13b489;if(_0x25b69c instanceof Error){let _0x4b5848=_0x25b69c['code'];return{...typeof _0x4b5848==_0x2da3f8(0x1b0)?{'code':_0x4b5848}:{},'message':_0x25b69c['message'],'name':_0x25b69c[_0x2da3f8(0x196)]};}return{'message':String(_0x25b69c),'name':_0x2da3f8(0x1a8)};}function J(_0x4eec6b,_0x5999f4){const _0x34696b=_0x13b489;return Object[_0x34696b(0x189)](Error(_0x5999f4),{'code':_0x4eec6b});}async function Y(_0x2d5056){const _0x4afdbd=_0x13b489;if(process[_0x4afdbd(0x1f0)]===_0x4afdbd(0x1eb)){if(await X(_0x2d5056))throw Z(_0x2d5056);return;}try{if(!(await _0xb08d28(_0x2d5056))['isSocket']())throw Error('Refusing\x20to\x20replace\x20non-socket\x20path\x20'+_0x2d5056);if(await X(_0x2d5056))throw Z(_0x2d5056);await _0x308563(_0x2d5056);}catch(_0x5c1705){if(Q(_0x5c1705))return;throw _0x5c1705;}}function X(_0x46dc93){return new Promise((_0xac3bcb,_0x35c17d)=>{const _0x226e88=_0x1f66;let _0x405cc2=_0x3d54f0(_0x46dc93);_0x405cc2[_0x226e88(0x18f)](_0x226e88(0x1da),()=>{const _0xce7d1e=_0x226e88;_0x405cc2[_0xce7d1e(0x182)](),_0xac3bcb(!0x0);}),_0x405cc2[_0x226e88(0x18f)]('error',_0x453a71=>{_0x405cc2['destroy'](),ae(_0x453a71)||Q(_0x453a71)?_0xac3bcb(!0x1):_0x35c17d(_0x453a71);});});}function Z(_0x3691ff){const _0x37559a=_0x13b489;return Object[_0x37559a(0x189)](Error(_0x37559a(0x1be)+_0x3691ff),{'code':_0x37559a(0x1ba)});}async function ie(_0x5b1dbe){const _0x38e5db=_0x13b489;if(process[_0x38e5db(0x1f0)]!==_0x38e5db(0x1eb))try{(await _0xb08d28(_0x5b1dbe))[_0x38e5db(0x1ef)]()&&await _0x308563(_0x5b1dbe);}catch(_0x104d0c){if(!Q(_0x104d0c))throw _0x104d0c;}}function Q(_0x1f9472){const _0x53499c=_0x13b489;return $(_0x1f9472)&&_0x1f9472[_0x53499c(0x1bd)]===_0x53499c(0x1c9);}function ae(_0x6ef74a){const _0x30dd11=_0x13b489;return $(_0x6ef74a)&&_0x6ef74a[_0x30dd11(0x1bd)]===_0x30dd11(0x1ec);}function oe(_0x235850){const _0x454b11=_0x13b489;return $(_0x235850)&&_0x235850['code']===_0x454b11(0x1ca);}function se(_0x2da34f){const _0x6e167f=_0x13b489;if(_0x2da34f[_0x6e167f(0x180)]===0x0)throw Error(_0x6e167f(0x197));}function $(_0x24284b){const _0x3e4b5f=_0x13b489;return typeof _0x24284b==_0x3e4b5f(0x187)&&!!_0x24284b&&!Array[_0x3e4b5f(0x19a)](_0x24284b);}export{te as DAEMON_PROTOCOL_VERSION,T as DAEMON_SHUTDOWN_METHOD,f as DAEMON_SOCKET_ENV,w as DAEMON_STATUS_METHOD,V as createDaemonClient,k as createDaemonControl,H as createDaemonServer};
|