@univer-cli/daemon 1.4.0 → 1.6.0
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 _0x2e0ecc=_0x5281;(function(_0x2256fb,_0x545e08){const _0x3a485a=_0x5281,_0x34a30f=_0x2256fb();while(!![]){try{const _0x7f1086=-parseInt(_0x3a485a(0x96))/0x1+parseInt(_0x3a485a(0x92))/0x2*(parseInt(_0x3a485a(0xe7))/0x3)+parseInt(_0x3a485a(0xd9))/0x4+-parseInt(_0x3a485a(0x71))/0x5*(parseInt(_0x3a485a(0x70))/0x6)+-parseInt(_0x3a485a(0x93))/0x7+parseInt(_0x3a485a(0x75))/0x8+parseInt(_0x3a485a(0xd6))/0x9;if(_0x7f1086===_0x545e08)break;else _0x34a30f['push'](_0x34a30f['shift']());}catch(_0x46a766){_0x34a30f['push'](_0x34a30f['shift']());}}}(_0x98d6,0x98973));import{randomUUID as _0x4f8ca7}from'node:crypto';import{spawn as _0x291f55}from'node:child_process';import{connect as _0x3adafd,createServer as _0x48e65a}from'node:net';import{fileURLToPath as _0x4221be}from'node:url';import{StringDecoder as _0x426539}from'node:string_decoder';import{lstat as _0x1469d1,mkdir as _0x4f5381,unlink as _0x28b9f8}from'node:fs/promises';import{dirname as _0xaab290}from'node:path';function _0x98d6(){const _0x3f2582=['ENOTCONN','set','push','DAEMON_INCOMPATIBLE','clear','identity.id','daemon.status','Daemon\x20is\x20not\x20listening\x20on\x20','message','EADDRINUSE','payload','20703897SjQsrO','unref','protocolVersion','583484dTQDTc','isFinite','assign','Refusing\x20to\x20replace\x20non-socket\x20path\x20','type','legacy-protocol','utf8','ready','build-id-mismatch','string','startedAt','version','Invalid\x20daemon\x20response','requestTimeoutMs','9bRRgAP','shutdown','win32','length','Daemon\x20method\x20namespace\x20is\x20reserved:\x20','24tzXILu','1366205LWmMSg','has','onShutdown','DAEMON_STOP_TIMEOUT','5405440UfHGEx','DAEMON_INVALID_REQUEST','identity.version','execPath','Daemon\x20server\x20has\x20not\x20started\x20listening','object','pid','startTimeoutMs','Daemon\x20is\x20not\x20ready:\x20','close','connect','Daemon\x20did\x20not\x20stop\x20within\x20','isSafeInteger','DAEMON_CONNECTION_CLOSED','A\x20daemon\x20is\x20already\x20listening\x20on\x20','status','identity','version-mismatch','incompatible','DAEMON_CONTROL_INVALID_RESPONSE','DAEMON_REQUEST_TIMEOUT','DAEMON_METHOD_NOT_FOUND','listen','stopTimeoutMs','platform','identity-mismatch','Daemon\x20did\x20not\x20start\x20within\x20','Unknown\x20daemon\x20method\x20','protocol-mismatch','223868bCPiFf','7859012ifKznX','buildId','number','617095jNgGom','write','catch','ENOENT','diagnostic','\x20is\x20already\x20registered','running','actual','once','end','\x20must\x20not\x20be\x20empty','timeoutMs','DAEMON_START_TIMEOUT','protocol','stringify','indexOf','isArray','socketPath\x20must\x20not\x20be\x20empty','now','stopped','file:','env','destroy','method','exitCode','invalid-health','UNIVER_CLI_SDK_DAEMON_SOCKET','Error','delete','error','parse','name','data','Invalid\x20daemon\x20request','unreachable','Daemon\x20method\x20must\x20not\x20be\x20empty','start','startsWith','daemon.shutdown','socketPath','isNaN','get','code','result','Daemon\x20handlers\x20must\x20be\x20registered\x20before\x20listen()','trim','state','reason','Daemon\x20method\x20','href','slice','Daemon\x20connection\x20closed\x20before\x20a\x20response\x20was\x20received','ECONNREFUSED'];_0x98d6=function(){return _0x3f2582;};return _0x98d6();}function u(_0xd9089d){const _0x3547c8=_0x5281;return JSON[_0x3547c8(0xa4)](_0xd9089d)+'\x0a';}function d(_0xd6d847){const _0x395437=_0x5281;let _0x4e318e='',_0xb16988=new _0x426539(_0x395437(0xdf));return{'end'(){const _0x4a51ef=_0x395437;_0x4e318e+=_0xb16988['end'](),_0x4e318e[_0x4a51ef(0xc3)]()[_0x4a51ef(0xea)]>0x0&&_0xd6d847(_0x4e318e),_0x4e318e='';},'push'(_0x53b8fb){const _0x31b471=_0x395437;for(_0x4e318e+=_0xb16988[_0x31b471(0x97)](_0x53b8fb);;){let _0x16efd7=_0x4e318e[_0x31b471(0xa5)]('\x0a');if(_0x16efd7<0x0)return;let _0x2563ed=_0x4e318e['slice'](0x0,_0x16efd7);_0x4e318e=_0x4e318e[_0x31b471(0xc8)](_0x16efd7+0x1),_0x2563ed[_0x31b471(0xc3)]()['length']>0x0&&_0xd6d847(_0x2563ed);}}};}var f=_0x2e0ecc(0xb0);async function p(_0x12447c){const _0x48c591=_0x2e0ecc;_0x291f55(process[_0x48c591(0x78)],[_0x4221be(_0x12447c['entry'])],{'detached':!0x0,'env':{...process.env,..._0x12447c['options'][_0x48c591(0xab)],[f]:_0x12447c['options'][_0x48c591(0xbd)]},'stdio':'ignore'})[_0x48c591(0xd7)]();let _0x23d8f7=Date[_0x48c591(0xa8)]();for(;Date[_0x48c591(0xa8)]()-_0x23d8f7<_0x12447c[_0x48c591(0xa1)];){try{return await _0x12447c[_0x48c591(0xe0)]();}catch(_0x5185d9){if(!g(_0x5185d9))throw _0x5185d9;}await new Promise(_0x4c747b=>setTimeout(_0x4c747b,0x19));}throw Object[_0x48c591(0xdb)](Error(_0x48c591(0x8f)+String(_0x12447c[_0x48c591(0xa1)])+'ms'),{'code':_0x48c591(0xa2)});}function m(_0x4189a8,_0x70f069,_0xc034b2,_0x522c57){return new Promise((_0x2619e4,_0x13a7a6)=>{const _0x332c2f=_0x5281;let _0x531666=_0x3adafd(_0x4189a8),_0x486615=_0x4f8ca7(),_0x2ddb72=!0x1,_0x909d16=setTimeout(()=>{const _0x189a6f=_0x5281;_0x531666[_0x189a6f(0xac)](),_0x13a7a6(Object['assign'](Error('Daemon\x20request\x20timed\x20out\x20after\x20'+String(_0x522c57)+'ms'),{'code':_0x189a6f(0x89)}));},_0x522c57),_0x3d3a3c=_0x5deed7=>{_0x2ddb72||(_0x2ddb72=!0x0,clearTimeout(_0x909d16),_0x5deed7());},_0x24608e=d(_0x1abc2c=>{try{let _0x5bedc7=v(_0x1abc2c,_0x486615);_0x3d3a3c(()=>{const _0x2f1b0f=_0x5281;_0x531666['end'](),_0x5bedc7['type']===_0x2f1b0f(0xb3)?_0x13a7a6(ee(_0x5bedc7[_0x2f1b0f(0xb3)])):_0x2619e4(_0x5bedc7['result']);});}catch(_0x304ac4){_0x3d3a3c(()=>{const _0x40a5e8=_0x5281;_0x531666[_0x40a5e8(0xac)](),_0x13a7a6(_0x304ac4);});}});_0x531666[_0x332c2f(0x9e)](_0x332c2f(0xb3),_0x17d43d=>_0x3d3a3c(()=>{const _0x50fc19=_0x332c2f;_0x531666[_0x50fc19(0xac)](),_0x13a7a6(_0x17d43d);})),_0x531666['on'](_0x332c2f(0xb6),_0x49d301=>_0x24608e['push'](_0x49d301)),_0x531666['on'](_0x332c2f(0x9f),()=>{_0x24608e['end'](),_0x3d3a3c(()=>{const _0x33f694=_0x5281;_0x531666[_0x33f694(0xac)](),_0x13a7a6(_());});}),_0x531666['on'](_0x332c2f(0x7e),()=>_0x3d3a3c(()=>{const _0xd858b7=_0x332c2f;_0x531666[_0xd858b7(0xac)](),_0x13a7a6(_());})),_0x531666[_0x332c2f(0x9e)]('connect',()=>{const _0x1de5a0=_0x332c2f;_0x531666[_0x1de5a0(0x97)](u({'id':_0x486615,'method':_0x70f069,'payload':_0xc034b2}));});});}function h(_0x5061f4){const _0x46cffe=_0x2e0ecc;let _0x5a99f6=_0x5061f4 instanceof URL?_0x5061f4[_0x46cffe(0xc7)]:_0x5061f4;try{let _0x1a95dd=new URL(_0x5a99f6);if(_0x1a95dd[_0x46cffe(0xa3)]!==_0x46cffe(0xaa))throw Error();return _0x1a95dd[_0x46cffe(0xc7)];}catch{throw Error('Daemon\x20entry\x20must\x20be\x20an\x20absolute\x20file\x20URL');}}function g(_0x30acde){const _0x5313d3=_0x2e0ecc;return y(_0x30acde)?_0x30acde[_0x5313d3(0xc0)]===_0x5313d3(0x99)||_0x30acde['code']==='ECONNREFUSED':!0x1;}function _(){const _0x3310aa=_0x2e0ecc;return Object[_0x3310aa(0xdb)](Error(_0x3310aa(0xc9)),{'code':_0x3310aa(0x82)});}function v(_0x22b0d0,_0x47bdaa){const _0x32e308=_0x2e0ecc;let _0x4b2ee2=JSON[_0x32e308(0xb4)](_0x22b0d0);if(!y(_0x4b2ee2)||_0x4b2ee2['id']!==_0x47bdaa)throw Error(_0x32e308(0xe5));if(_0x4b2ee2[_0x32e308(0xdd)]===_0x32e308(0xc1)&&_0x32e308(0xc1)in _0x4b2ee2||_0x4b2ee2[_0x32e308(0xdd)]==='error'&&y(_0x4b2ee2[_0x32e308(0xb3)]))return _0x4b2ee2;throw Error('Invalid\x20daemon\x20response');}function ee(_0x249376){const _0x4929f1=_0x2e0ecc;let _0x158acc=Error(_0x249376[_0x4929f1(0xd3)]);return _0x249376['code']!==void 0x0&&Object['assign'](_0x158acc,{'code':_0x249376[_0x4929f1(0xc0)]}),_0x158acc[_0x4929f1(0xb5)]=_0x249376[_0x4929f1(0xb5)],_0x158acc;}function y(_0x8fb5a4){const _0xb41740=_0x2e0ecc;return typeof _0x8fb5a4=='object'&&!!_0x8fb5a4&&!Array[_0xb41740(0xa6)](_0x8fb5a4);}function b(_0x398f7c){const _0x5ac275=_0x2e0ecc;S(_0x398f7c['id'],_0x5ac275(0xd0)),S(_0x398f7c[_0x5ac275(0xe4)],_0x5ac275(0x77)),_0x398f7c[_0x5ac275(0x94)]!==void 0x0&&S(_0x398f7c['buildId'],'identity.buildId');}function x(_0x26fca6){const _0x518cd7=_0x2e0ecc;return C(_0x26fca6)&&typeof _0x26fca6['id']==_0x518cd7(0xe2)&&_0x26fca6['id']['length']>0x0&&typeof _0x26fca6[_0x518cd7(0xe4)]==_0x518cd7(0xe2)&&_0x26fca6[_0x518cd7(0xe4)]['length']>0x0&&(_0x26fca6['buildId']===void 0x0||typeof _0x26fca6[_0x518cd7(0x94)]==_0x518cd7(0xe2)&&_0x26fca6[_0x518cd7(0x94)]['length']>0x0);}function S(_0x286c39,_0x286ce3){const _0x58cb4f=_0x2e0ecc;if(_0x286c39['length']===0x0)throw Error(_0x286ce3+_0x58cb4f(0xa0));}function C(_0x30e53b){const _0x548c66=_0x2e0ecc;return typeof _0x30e53b==_0x548c66(0x7a)&&!!_0x30e53b&&!Array['isArray'](_0x30e53b);}var te=0x1,w=_0x2e0ecc(0xd1),T=_0x2e0ecc(0xbc);function E(_0x57e5ba){const _0x13a4e8=_0x2e0ecc;return _0x57e5ba[_0x13a4e8(0xbb)]('daemon.');}var D=0x2710;function O(_0x9da69d){const _0x29a0b8=_0x2e0ecc;b(_0x9da69d['identity']);let _0x4733c4=h(_0x9da69d['entry']),_0xdc951b=_0x9da69d[_0x29a0b8(0xe6)]??0x7530,_0x196e34=_0x9da69d[_0x29a0b8(0x7c)]??0x2710,_0x230d29=_0x9da69d[_0x29a0b8(0x8c)]??D;z(_0xdc951b,_0x29a0b8(0xe6)),z(_0x196e34,_0x29a0b8(0x7c)),z(_0x230d29,_0x29a0b8(0x8c));let _0x262d57=()=>({'socketPath':_0x9da69d[_0x29a0b8(0xbd)],'state':'stopped'}),_0x438a33=async()=>{const _0x3fcd02=_0x29a0b8;try{let _0x2b2078=N(await m(_0x9da69d[_0x3fcd02(0xbd)],w,null,_0xdc951b),_0x9da69d[_0x3fcd02(0xbd)]),_0x395529=A(_0x9da69d[_0x3fcd02(0x85)],_0x2b2078);return _0x395529===void 0x0?_0x2b2078:ne(_0x9da69d['identity'],_0x2b2078,_0x395529,_0x9da69d['socketPath']);}catch(_0x38356d){if(g(_0x38356d))return _0x262d57();let _0x34a43e=L(_0x38356d);return _0x34a43e[_0x3fcd02(0xc0)]==='DAEMON_METHOD_NOT_FOUND'?j(_0x9da69d[_0x3fcd02(0x85)],_0x3fcd02(0xde),_0x9da69d['socketPath'],_0x34a43e):_0x34a43e['code']===_0x3fcd02(0x88)?j(_0x9da69d[_0x3fcd02(0x85)],_0x3fcd02(0xaf),_0x9da69d[_0x3fcd02(0xbd)],_0x34a43e):{'diagnostic':_0x34a43e,'socketPath':_0x9da69d[_0x3fcd02(0xbd)],'state':_0x3fcd02(0xb8)};}},_0x198ea8=async()=>{const _0x2287a2=_0x29a0b8;let _0x33ed8c=await _0x438a33();if(_0x33ed8c[_0x2287a2(0xc4)]===_0x2287a2(0x9c))return{..._0x33ed8c,'started':!0x1};if(_0x33ed8c[_0x2287a2(0xc4)]!=='stopped')throw M(_0x33ed8c);return{...await p({'entry':_0x4733c4,'options':_0x9da69d,'ready':async()=>{const _0x1b708d=_0x2287a2;let _0x10b84d=await _0x438a33();if(_0x10b84d[_0x1b708d(0xc4)]==='stopped')throw F(_0x9da69d[_0x1b708d(0xbd)]);if(_0x10b84d[_0x1b708d(0xc4)]!=='running')throw M(_0x10b84d);return _0x10b84d;},'timeoutMs':_0x196e34}),'started':!0x0};},_0x47f615=async()=>{const _0x71b907=_0x29a0b8;let _0x16601d=await _0x438a33();if(_0x16601d[_0x71b907(0xc4)]===_0x71b907(0xa9))return{..._0x16601d,'stopped':!0x1};if(_0x16601d['state']!==_0x71b907(0x9c)&&!k(_0x16601d))throw M(_0x16601d);try{await m(_0x9da69d[_0x71b907(0xbd)],T,null,_0xdc951b);}catch(_0x4c4494){if(!I(_0x4c4494))throw _0x4c4494;}return await P(_0x438a33,_0x230d29),{..._0x262d57(),'stopped':!0x0};};return{async 'restart'(){const _0x2f0259=_0x29a0b8;let _0x430402=await _0x438a33();if(_0x430402['state']!=='running'&&_0x430402[_0x2f0259(0xc4)]!=='stopped'&&!k(_0x430402))throw M(_0x430402);(_0x430402[_0x2f0259(0xc4)]===_0x2f0259(0x9c)||k(_0x430402))&&await _0x47f615();let _0x20bf86=await _0x198ea8(),_0x483ba2=_0x430402[_0x2f0259(0xc4)]===_0x2f0259(0x9c)?_0x430402[_0x2f0259(0x7b)]:k(_0x430402)?_0x430402[_0x2f0259(0x9d)]['pid']:void 0x0;return{'identity':_0x20bf86[_0x2f0259(0x85)],'pid':_0x20bf86[_0x2f0259(0x7b)],..._0x483ba2===void 0x0?{}:{'previousPid':_0x483ba2},'restarted':_0x430402[_0x2f0259(0xc4)]!==_0x2f0259(0xa9),'protocolVersion':_0x20bf86[_0x2f0259(0xd8)],'socketPath':_0x20bf86[_0x2f0259(0xbd)],'startedAt':_0x20bf86[_0x2f0259(0xe3)],'state':_0x2f0259(0x9c)};},'start':_0x198ea8,'status':_0x438a33,'stop':_0x47f615};}function k(_0x557c9e){const _0x34dc98=_0x2e0ecc;return _0x557c9e['state']===_0x34dc98(0x87)&&_0x557c9e['actual']!==void 0x0&&(_0x557c9e[_0x34dc98(0xc5)]===_0x34dc98(0x86)||_0x557c9e['reason']===_0x34dc98(0xe1));}function _0x5281(_0x1a22b6,_0x3ca7d4){_0x1a22b6=_0x1a22b6-0x6f;const _0x98d649=_0x98d6();let _0x528146=_0x98d649[_0x1a22b6];return _0x528146;}function A(_0x45be2f,_0x10ad23){const _0x9fcdc0=_0x2e0ecc;if(_0x10ad23[_0x9fcdc0(0xd8)]!==0x1)return _0x9fcdc0(0x91);if(_0x10ad23[_0x9fcdc0(0x85)]['id']!==_0x45be2f['id'])return _0x9fcdc0(0x8e);if(_0x10ad23[_0x9fcdc0(0x85)]['version']!==_0x45be2f[_0x9fcdc0(0xe4)])return _0x9fcdc0(0x86);if(_0x45be2f['buildId']!==void 0x0&&_0x10ad23['identity'][_0x9fcdc0(0x94)]!==_0x45be2f[_0x9fcdc0(0x94)])return _0x9fcdc0(0xe1);}function ne(_0x16c2df,_0x1904fa,_0x514d2c,_0x4d64ca){const _0x522057=_0x2e0ecc;return{'actual':{'identity':_0x1904fa[_0x522057(0x85)],'pid':_0x1904fa[_0x522057(0x7b)],'protocolVersion':_0x1904fa[_0x522057(0xd8)],'socketPath':_0x1904fa['socketPath'],'startedAt':_0x1904fa[_0x522057(0xe3)]},'expected':{'identity':_0x16c2df,'protocolVersion':0x1},'reason':_0x514d2c,'socketPath':_0x4d64ca,'state':_0x522057(0x87)};}function j(_0xd0ecb2,_0x32afa9,_0xc1c4da,_0x442748){const _0x44cce6=_0x2e0ecc;return{'diagnostic':_0x442748,'expected':{'identity':_0xd0ecb2,'protocolVersion':0x1},'reason':_0x32afa9,'socketPath':_0xc1c4da,'state':_0x44cce6(0x87)};}function M(_0x271b49){const _0x4c57f4=_0x2e0ecc;let _0x5a61eb=_0x271b49[_0x4c57f4(0xc4)]===_0x4c57f4(0x87)?_0x271b49['reason']:_0x271b49[_0x4c57f4(0x9a)][_0x4c57f4(0xd3)];return R(_0x271b49[_0x4c57f4(0xc4)]===_0x4c57f4(0x87)?_0x4c57f4(0xce):'DAEMON_UNREACHABLE',_0x4c57f4(0x7d)+_0x5a61eb);}function N(_0x1edafc,_0x499fef){const _0x208834=_0x2e0ecc;if(!B(_0x1edafc)||_0x1edafc[_0x208834(0xc4)]!=='running'||_0x1edafc['socketPath']!==_0x499fef||!x(_0x1edafc[_0x208834(0x85)])||typeof _0x1edafc[_0x208834(0x7b)]!=_0x208834(0x95)||!Number[_0x208834(0x81)](_0x1edafc[_0x208834(0x7b)])||_0x1edafc[_0x208834(0x7b)]<=0x0||typeof _0x1edafc[_0x208834(0xd8)]!='number'||!Number['isSafeInteger'](_0x1edafc[_0x208834(0xd8)])||_0x1edafc[_0x208834(0xd8)]<=0x0||typeof _0x1edafc[_0x208834(0xe3)]!=_0x208834(0xe2)||Number[_0x208834(0xbe)](Date['parse'](_0x1edafc[_0x208834(0xe3)])))throw R(_0x208834(0x88),'Daemon\x20status\x20response\x20is\x20invalid');return{'identity':_0x1edafc[_0x208834(0x85)],'pid':_0x1edafc[_0x208834(0x7b)],'protocolVersion':_0x1edafc[_0x208834(0xd8)],'socketPath':_0x499fef,'startedAt':_0x1edafc[_0x208834(0xe3)],'state':_0x208834(0x9c)};}async function P(_0x43b5aa,_0x2991fc){const _0x385d2b=_0x2e0ecc;let _0x4915ea=Date[_0x385d2b(0xa8)]();for(;Date['now']()-_0x4915ea<_0x2991fc;){if((await _0x43b5aa())['state']==='stopped')return;await new Promise(_0x351190=>setTimeout(_0x351190,0x19));}throw R(_0x385d2b(0x74),_0x385d2b(0x80)+String(_0x2991fc)+'ms');}function F(_0x3f30bc){const _0x11589d=_0x2e0ecc;return Object[_0x11589d(0xdb)](Error(_0x11589d(0xd2)+_0x3f30bc),{'code':_0x11589d(0xca)});}function I(_0x2b2427){const _0x19f19d=_0x2e0ecc;return g(_0x2b2427)||B(_0x2b2427)&&(_0x2b2427[_0x19f19d(0xc0)]==='DAEMON_CONNECTION_CLOSED'||_0x2b2427[_0x19f19d(0xc0)]==='ECONNRESET'||_0x2b2427[_0x19f19d(0xc0)]===_0x19f19d(0xcb)||_0x2b2427['code']==='EPIPE');}function L(_0x44193c){const _0x3ddcdb=_0x2e0ecc;let _0x32b1cb=_0x44193c instanceof Error?_0x44193c[_0x3ddcdb(0xd3)]:String(_0x44193c);return B(_0x44193c)&&typeof _0x44193c[_0x3ddcdb(0xc0)]==_0x3ddcdb(0xe2)?{'code':_0x44193c[_0x3ddcdb(0xc0)],'message':_0x32b1cb}:{'message':_0x32b1cb};}function R(_0x5959ed,_0x212823){const _0x230749=_0x2e0ecc;return Object[_0x230749(0xdb)](Error(_0x212823),{'code':_0x5959ed});}function z(_0x3f7dd1,_0x7bf983){const _0xd792c2=_0x2e0ecc;if(!Number[_0xd792c2(0xda)](_0x3f7dd1)||_0x3f7dd1<=0x0)throw Error(_0x7bf983+'\x20must\x20be\x20a\x20finite\x20positive\x20number');}function B(_0x6c3923){const _0x113591=_0x2e0ecc;return typeof _0x6c3923==_0x113591(0x7a)&&!!_0x6c3923&&!Array[_0x113591(0xa6)](_0x6c3923);}function V(_0x32383e){let _0x5ae84d=_0x32383e['requestTimeoutMs']??0x7530,_0x55764f=O(_0x32383e),_0x567b41,_0x85d60a=async()=>{const _0x1475ae=_0x5281;let _0xe5422c=await _0x55764f['status']();if(_0xe5422c['state']===_0x1475ae(0x9c))return _0xe5422c;if(_0xe5422c[_0x1475ae(0xc4)]!==_0x1475ae(0xa9))throw M(_0xe5422c);let _0x31f2f0=_0x567b41??=_0x55764f[_0x1475ae(0xba)]();try{return await _0x31f2f0;}finally{_0x567b41===_0x31f2f0&&(_0x567b41=void 0x0);}};return{async 'request'(_0x406986,_0x94a8b3){const _0x475e17=_0x5281;if(_0x406986['length']===0x0)throw Error(_0x475e17(0xb9));await _0x85d60a();try{return await m(_0x32383e[_0x475e17(0xbd)],_0x406986,_0x94a8b3,_0x5ae84d);}catch(_0x3aea73){if(!g(_0x3aea73))throw _0x3aea73;}return await _0x85d60a(),await m(_0x32383e['socketPath'],_0x406986,_0x94a8b3,_0x5ae84d);}};}function H(_0x24892c){const _0x4693b2=_0x2e0ecc;oe(_0x24892c[_0x4693b2(0xbd)]),b(_0x24892c[_0x4693b2(0x85)]);let _0x33d984=new Map(),_0x3d4bae=new Set(),_0x3029d7,_0x263e09=!0x1,_0x30d4d1,_0x55898f,_0x115000={async 'close'(){_0x30d4d1??=_0x2c1f2b(),await _0x30d4d1;},'handle'(_0x1f3bcc,_0x1b059b){const _0x4a6ca8=_0x4693b2;if(_0x263e09)throw Error(_0x4a6ca8(0xc2));if(_0x1f3bcc['length']===0x0)throw Error(_0x4a6ca8(0xb9));if(E(_0x1f3bcc))throw Error(_0x4a6ca8(0x6f)+_0x1f3bcc);if(_0x33d984[_0x4a6ca8(0x72)](_0x1f3bcc))throw Error(_0x4a6ca8(0xc6)+_0x1f3bcc+_0x4a6ca8(0x9b));_0x33d984[_0x4a6ca8(0xcc)](_0x1f3bcc,_0x1b059b);},async 'listen'(){const _0x4eae19=_0x4693b2;if(!_0x263e09){if(_0x30d4d1)throw Error('Daemon\x20server\x20is\x20closed');process[_0x4eae19(0x8d)]!==_0x4eae19(0xe9)&&await _0x4f5381(_0xaab290(_0x24892c[_0x4eae19(0xbd)]),{'recursive':!0x0}),await Y(_0x24892c['socketPath']),_0x3029d7=_0x48e65a(_0x21c1bb=>U(_0x21c1bb,_0x33d984,_0x3d4bae,{'shutdown':()=>{const _0x214302=_0x4eae19;_0x115000['close']()[_0x214302(0x98)](()=>{const _0x1fd1c1=_0x214302;process[_0x1fd1c1(0xae)]=0x1;});},'status':()=>G(_0x24892c['identity'],_0x24892c[_0x4eae19(0xbd)],_0x55898f)})),await new Promise((_0x58386d,_0x106ffc)=>{const _0xcd25c=_0x4eae19;let _0x2cbb5f=_0x3029d7,_0x442c27=_0x688653=>_0x106ffc(ae(_0x688653)?Z(_0x24892c[_0xcd25c(0xbd)]):_0x688653);_0x2cbb5f[_0xcd25c(0x9e)](_0xcd25c(0xb3),_0x442c27),_0x2cbb5f[_0xcd25c(0x8b)](_0x24892c[_0xcd25c(0xbd)],()=>{_0x2cbb5f['off']('error',_0x442c27),_0x263e09=!0x0,_0x55898f=new Date()['toISOString'](),_0x58386d();});});}}};return _0x115000;async function _0x2c1f2b(){const _0x28d734=_0x4693b2;for(let _0x49d7fd of _0x3d4bae)_0x49d7fd['destroy']();_0x3d4bae[_0x28d734(0xcf)](),_0x3029d7&&_0x263e09&&await new Promise((_0x2a7106,_0x6332e4)=>{const _0x5528bb=_0x28d734;_0x3029d7[_0x5528bb(0x7e)](_0x160528=>_0x160528?_0x6332e4(_0x160528):_0x2a7106());}),_0x263e09=!0x1;try{await _0x24892c[_0x28d734(0x73)]?.();}finally{await re(_0x24892c[_0x28d734(0xbd)]);}}}function U(_0x504096,_0x466139,_0x36ca6d,_0x44b628){const _0x53d609=_0x2e0ecc;_0x36ca6d['add'](_0x504096);let _0x4f3136=!0x1,_0x210f80=d(_0x3bc7ef=>{_0x4f3136||(_0x4f3136=!0x0,W(_0x504096,_0x3bc7ef,_0x466139,_0x44b628));});_0x504096['on'](_0x53d609(0xb6),_0x71c10f=>_0x210f80[_0x53d609(0xcd)](_0x71c10f)),_0x504096['on'](_0x53d609(0x9f),()=>_0x210f80[_0x53d609(0x9f)]()),_0x504096['on']('close',()=>_0x36ca6d[_0x53d609(0xb2)](_0x504096)),_0x504096['on']('error',()=>_0x504096[_0x53d609(0xac)]());}async function W(_0x31e299,_0x54c5be,_0x5c831c,_0xb1af0a){const _0x275f17=_0x2e0ecc;let _0x3054e2='unknown',_0x5659b7,_0x17aef8=!0x1;try{let _0xf58c2d=K(_0x54c5be);_0x3054e2=_0xf58c2d['id'];let _0x55f4de;if(_0xf58c2d['method']===_0x275f17(0xd1)){let _0x37d4ba=_0xb1af0a[_0x275f17(0x84)]();_0x55f4de={'identity':{..._0x37d4ba[_0x275f17(0x85)]['buildId']===void 0x0?{}:{'buildId':_0x37d4ba[_0x275f17(0x85)][_0x275f17(0x94)]},'id':_0x37d4ba['identity']['id'],'version':_0x37d4ba['identity']['version']},'pid':_0x37d4ba[_0x275f17(0x7b)],'protocolVersion':_0x37d4ba['protocolVersion'],'socketPath':_0x37d4ba['socketPath'],'startedAt':_0x37d4ba[_0x275f17(0xe3)],'state':_0x37d4ba[_0x275f17(0xc4)]};}else{if(_0xf58c2d['method']===_0x275f17(0xbc))_0x55f4de=null,_0x17aef8=!0x0;else{let _0x97c6b7=_0x5c831c[_0x275f17(0xbf)](_0xf58c2d[_0x275f17(0xad)]);if(!_0x97c6b7)throw J(_0x275f17(0x8a),_0x275f17(0x90)+_0xf58c2d[_0x275f17(0xad)]);_0x55f4de=await _0x97c6b7(_0xf58c2d[_0x275f17(0xd5)]);}}_0x5659b7={'id':_0x3054e2,'result':_0x55f4de,'type':_0x275f17(0xc1)};}catch(_0x4e2b7d){_0x5659b7={'error':q(_0x4e2b7d),'id':_0x3054e2,'type':_0x275f17(0xb3)};}_0x31e299['end'](u(_0x5659b7),()=>{const _0x3c3e17=_0x275f17;_0x17aef8&&_0xb1af0a[_0x3c3e17(0xe8)]();});}function G(_0x43c33f,_0xed47df,_0x459dab){const _0x2addd7=_0x2e0ecc;if(_0x459dab===void 0x0)throw Error(_0x2addd7(0x79));return{'identity':_0x43c33f,'pid':process['pid'],'protocolVersion':0x1,'socketPath':_0xed47df,'startedAt':_0x459dab,'state':'running'};}function K(_0x290742){const _0x40f685=_0x2e0ecc;let _0x202fb1=JSON[_0x40f685(0xb4)](_0x290742);if(!$(_0x202fb1)||typeof _0x202fb1['id']!='string'||typeof _0x202fb1[_0x40f685(0xad)]!=_0x40f685(0xe2)||!(_0x40f685(0xd5)in _0x202fb1))throw J(_0x40f685(0x76),_0x40f685(0xb7));return _0x202fb1;}function q(_0x4bed9d){const _0x4e4120=_0x2e0ecc;if(_0x4bed9d instanceof Error){let _0x2de85b=_0x4bed9d[_0x4e4120(0xc0)];return{...typeof _0x2de85b=='string'?{'code':_0x2de85b}:{},'message':_0x4bed9d['message'],'name':_0x4bed9d[_0x4e4120(0xb5)]};}return{'message':String(_0x4bed9d),'name':_0x4e4120(0xb1)};}function J(_0x351ca2,_0x475bca){const _0x22e07b=_0x2e0ecc;return Object[_0x22e07b(0xdb)](Error(_0x475bca),{'code':_0x351ca2});}async function Y(_0x226235){const _0x11b4a2=_0x2e0ecc;if(process[_0x11b4a2(0x8d)]===_0x11b4a2(0xe9)){if(await X(_0x226235))throw Z(_0x226235);return;}try{if(!(await _0x1469d1(_0x226235))['isSocket']())throw Error(_0x11b4a2(0xdc)+_0x226235);if(await X(_0x226235))throw Z(_0x226235);await _0x28b9f8(_0x226235);}catch(_0x4d9750){if(Q(_0x4d9750))return;throw _0x4d9750;}}function X(_0x31ac11){return new Promise((_0x41a8d5,_0x3f135a)=>{const _0x519d84=_0x5281;let _0x38fb3e=_0x3adafd(_0x31ac11);_0x38fb3e[_0x519d84(0x9e)](_0x519d84(0x7f),()=>{_0x38fb3e['destroy'](),_0x41a8d5(!0x0);}),_0x38fb3e['once'](_0x519d84(0xb3),_0xf5f8fe=>{const _0x1f3a81=_0x519d84;_0x38fb3e[_0x1f3a81(0xac)](),ie(_0xf5f8fe)||Q(_0xf5f8fe)?_0x41a8d5(!0x1):_0x3f135a(_0xf5f8fe);});});}function Z(_0x44f7a5){const _0x25436d=_0x2e0ecc;return Object[_0x25436d(0xdb)](Error(_0x25436d(0x83)+_0x44f7a5),{'code':'DAEMON_ALREADY_RUNNING'});}async function re(_0x28878b){const _0x65553=_0x2e0ecc;if(process[_0x65553(0x8d)]!==_0x65553(0xe9))try{(await _0x1469d1(_0x28878b))['isSocket']()&&await _0x28b9f8(_0x28878b);}catch(_0x5b1739){if(!Q(_0x5b1739))throw _0x5b1739;}}function Q(_0x1f0692){const _0x54e8ed=_0x2e0ecc;return $(_0x1f0692)&&_0x1f0692[_0x54e8ed(0xc0)]==='ENOENT';}function ie(_0x16e5cb){const _0x195763=_0x2e0ecc;return $(_0x16e5cb)&&_0x16e5cb[_0x195763(0xc0)]===_0x195763(0xca);}function ae(_0xc20218){const _0x39d23b=_0x2e0ecc;return $(_0xc20218)&&_0xc20218['code']===_0x39d23b(0xd4);}function oe(_0x1a5a50){const _0xfdbaa1=_0x2e0ecc;if(_0x1a5a50['length']===0x0)throw Error(_0xfdbaa1(0xa7));}function $(_0x372763){const _0x34e8fe=_0x2e0ecc;return typeof _0x372763=='object'&&!!_0x372763&&!Array[_0x34e8fe(0xa6)](_0x372763);}export{te as DAEMON_PROTOCOL_VERSION,T as DAEMON_SHUTDOWN_METHOD,f as DAEMON_SOCKET_ENV,w as DAEMON_STATUS_METHOD,V as createDaemonClient,O as createDaemonControl,H as createDaemonServer};
|