@dev-anywhere/proxy 0.9.9 → 0.9.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{autostart-TGMTRK7L.js → autostart-RRSXYZND.js} +7 -7
- package/dist/{chunk-7EOSTWVO.js → chunk-4EIUH7CQ.js} +2 -2
- package/dist/{chunk-HEXGO236.js → chunk-E2S3REKI.js} +2 -2
- package/dist/chunk-G4QN6LOR.js +149 -0
- package/dist/chunk-G4QN6LOR.js.map +1 -0
- package/dist/{chunk-QZJBIFGW.js → chunk-UEIKYXS7.js} +2 -2
- package/dist/{chunk-AZ5MTPUR.js → chunk-VYAEW7G6.js} +2 -2
- package/dist/{chunk-JRSPTWQB.js → chunk-WTCJIDDT.js} +12 -1
- package/dist/chunk-WTCJIDDT.js.map +1 -0
- package/dist/{chunk-DEL6NNYV.js → chunk-YNDDXMND.js} +2 -2
- package/dist/{chunk-MPW6H537.js → chunk-Z2KUJ6SW.js} +3 -3
- package/dist/index.js +8 -8
- package/dist/{logger-2EQWS3V2.js → logger-6MR4NSOC.js} +2 -2
- package/dist/preview-worker.js +2 -2
- package/dist/{relay-token-SK3OOH2H.js → relay-token-KHOXKEF2.js} +3 -3
- package/dist/serve.js +7 -6
- package/dist/serve.js.map +1 -1
- package/dist/{service-host-YEX4IBZO.js → service-host-FAPIR5IX.js} +4 -4
- package/dist/session-worker.js +1 -1
- package/dist/{terminal-H6DLED7O.js → terminal-7ZS7U6OX.js} +7 -7
- package/dist/terminal-worker.js +7 -7
- package/dist/update-runner.js +20 -10
- package/dist/update-runner.js.map +1 -1
- package/package.json +3 -3
- package/dist/chunk-77QVUYU7.js +0 -42
- package/dist/chunk-77QVUYU7.js.map +0 -1
- package/dist/chunk-JRSPTWQB.js.map +0 -1
- /package/dist/{autostart-TGMTRK7L.js.map → autostart-RRSXYZND.js.map} +0 -0
- /package/dist/{chunk-7EOSTWVO.js.map → chunk-4EIUH7CQ.js.map} +0 -0
- /package/dist/{chunk-HEXGO236.js.map → chunk-E2S3REKI.js.map} +0 -0
- /package/dist/{chunk-QZJBIFGW.js.map → chunk-UEIKYXS7.js.map} +0 -0
- /package/dist/{chunk-AZ5MTPUR.js.map → chunk-VYAEW7G6.js.map} +0 -0
- /package/dist/{chunk-DEL6NNYV.js.map → chunk-YNDDXMND.js.map} +0 -0
- /package/dist/{chunk-MPW6H537.js.map → chunk-Z2KUJ6SW.js.map} +0 -0
- /package/dist/{logger-2EQWS3V2.js.map → logger-6MR4NSOC.js.map} +0 -0
- /package/dist/{relay-token-SK3OOH2H.js.map → relay-token-KHOXKEF2.js.map} +0 -0
- /package/dist/{service-host-YEX4IBZO.js.map → service-host-FAPIR5IX.js.map} +0 -0
- /package/dist/{terminal-H6DLED7O.js.map → terminal-7ZS7U6OX.js.map} +0 -0
|
@@ -7,18 +7,18 @@ import {
|
|
|
7
7
|
} from "./chunk-5OARBB2B.js";
|
|
8
8
|
import {
|
|
9
9
|
createProfileServiceLifecycle
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-Z2KUJ6SW.js";
|
|
11
11
|
import {
|
|
12
12
|
requestServiceHost
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-YNDDXMND.js";
|
|
14
|
+
import "./chunk-VYAEW7G6.js";
|
|
15
15
|
import {
|
|
16
16
|
IS_DEV,
|
|
17
17
|
resolveTopLevelScript
|
|
18
18
|
} from "./chunk-AS7W2D2X.js";
|
|
19
19
|
import "./chunk-3NUN2VYO.js";
|
|
20
20
|
import "./chunk-CFO5GU5U.js";
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-G4QN6LOR.js";
|
|
22
22
|
import "./chunk-ZRCMGVGT.js";
|
|
23
23
|
import {
|
|
24
24
|
quoteWindowsArgument
|
|
@@ -899,7 +899,7 @@ async function startAutostartService(daemon, system = false) {
|
|
|
899
899
|
}
|
|
900
900
|
if (system) {
|
|
901
901
|
if (daemon) throw new Error("The system service host must remain in the foreground");
|
|
902
|
-
const { startSystemServiceHost } = await import("./service-host-
|
|
902
|
+
const { startSystemServiceHost } = await import("./service-host-FAPIR5IX.js");
|
|
903
903
|
await startSystemServiceHost();
|
|
904
904
|
return;
|
|
905
905
|
}
|
|
@@ -911,7 +911,7 @@ async function startAutostartService(daemon, system = false) {
|
|
|
911
911
|
await startService();
|
|
912
912
|
});
|
|
913
913
|
} catch (error) {
|
|
914
|
-
const { serviceLogger } = await import("./logger-
|
|
914
|
+
const { serviceLogger } = await import("./logger-6MR4NSOC.js");
|
|
915
915
|
const { flushLogger } = await import("./logger-24TGGN76.js");
|
|
916
916
|
serviceLogger.error({ err: getErrorMessage(error) }, "Proxy automatic startup failed");
|
|
917
917
|
await flushLogger(serviceLogger);
|
|
@@ -922,4 +922,4 @@ export {
|
|
|
922
922
|
runAutostartCommand,
|
|
923
923
|
startAutostartService
|
|
924
924
|
};
|
|
925
|
-
//# sourceMappingURL=autostart-
|
|
925
|
+
//# sourceMappingURL=autostart-RRSXYZND.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
VALID_LOG_LEVELS,
|
|
7
7
|
loadProxyRuntimeEnv,
|
|
8
8
|
serviceLogger
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-WTCJIDDT.js";
|
|
10
10
|
import {
|
|
11
11
|
CONFIG_PATH,
|
|
12
12
|
PROFILE_NAME,
|
|
@@ -226,4 +226,4 @@ export {
|
|
|
226
226
|
buildProviderEnv,
|
|
227
227
|
saveAgentCliPath
|
|
228
228
|
};
|
|
229
|
-
//# sourceMappingURL=chunk-
|
|
229
|
+
//# sourceMappingURL=chunk-4EIUH7CQ.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
createProfileServiceLifecycle
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-Z2KUJ6SW.js";
|
|
5
5
|
import {
|
|
6
6
|
TERMINAL_ADMISSION_FRAME_MAX_BYTES,
|
|
7
7
|
TERMINAL_ADMISSION_VERSION,
|
|
@@ -244,4 +244,4 @@ export {
|
|
|
244
244
|
requestTerminalAdmission,
|
|
245
245
|
swapServeSocket
|
|
246
246
|
};
|
|
247
|
-
//# sourceMappingURL=chunk-
|
|
247
|
+
//# sourceMappingURL=chunk-E2S3REKI.js.map
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/common/local-ipc-endpoint.ts
|
|
4
|
+
import { chmodSync, existsSync as existsSync2, mkdirSync as mkdirSync2 } from "fs";
|
|
5
|
+
import { dirname } from "path";
|
|
6
|
+
|
|
7
|
+
// src/common/safe-unlink.ts
|
|
8
|
+
import { unlinkSync } from "fs";
|
|
9
|
+
function unlinkIfPresent(path, unlink = unlinkSync) {
|
|
10
|
+
try {
|
|
11
|
+
unlink(path);
|
|
12
|
+
} catch (err) {
|
|
13
|
+
if (err.code === "ENOENT") return;
|
|
14
|
+
throw err;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// src/common/windows-pipe-permissions.ts
|
|
19
|
+
import { execFileSync } from "child_process";
|
|
20
|
+
import { createHash } from "crypto";
|
|
21
|
+
import { existsSync, mkdirSync, renameSync, rmSync } from "fs";
|
|
22
|
+
import { homedir } from "os";
|
|
23
|
+
import { join } from "path";
|
|
24
|
+
var SOURCE = `using System;
|
|
25
|
+
using System.ComponentModel;
|
|
26
|
+
using System.IO;
|
|
27
|
+
using System.IO.Pipes;
|
|
28
|
+
using System.Runtime.InteropServices;
|
|
29
|
+
using System.Security.AccessControl;
|
|
30
|
+
using System.Security.Principal;
|
|
31
|
+
using Microsoft.Win32.SafeHandles;
|
|
32
|
+
|
|
33
|
+
public static class DevAnywherePipePermissions {
|
|
34
|
+
[DllImport("kernel32.dll", SetLastError = true)]
|
|
35
|
+
private static extern bool GetNamedPipeServerProcessId(SafePipeHandle pipe, out uint pid);
|
|
36
|
+
[DllImport("advapi32.dll", SetLastError = true)]
|
|
37
|
+
private static extern bool SetKernelObjectSecurity(SafePipeHandle handle, uint information, byte[] descriptor);
|
|
38
|
+
|
|
39
|
+
public static int Main(string[] args) {
|
|
40
|
+
Console.OutputEncoding = new System.Text.UTF8Encoding(false);
|
|
41
|
+
try {
|
|
42
|
+
if (args.Length != 2 || !(args[0].StartsWith(@"\\\\.\\pipe\\") || args[0].StartsWith(@"\\\\?\\pipe\\")))
|
|
43
|
+
throw new ArgumentException("Expected a local named pipe and its server PID");
|
|
44
|
+
uint expectedPid = uint.Parse(args[1]);
|
|
45
|
+
var rights = PipeAccessRights.ReadWrite | PipeAccessRights.ReadPermissions |
|
|
46
|
+
PipeAccessRights.ChangePermissions | PipeAccessRights.TakeOwnership;
|
|
47
|
+
using (var pipe = new NamedPipeClientStream(".", args[0].Substring(9), rights,
|
|
48
|
+
PipeOptions.None, TokenImpersonationLevel.Identification, HandleInheritability.None)) {
|
|
49
|
+
pipe.Connect(3000);
|
|
50
|
+
uint serverPid;
|
|
51
|
+
if (!GetNamedPipeServerProcessId(pipe.SafePipeHandle, out serverPid))
|
|
52
|
+
throw new Win32Exception(Marshal.GetLastWin32Error());
|
|
53
|
+
if (serverPid != expectedPid) throw new InvalidOperationException("Named pipe belongs to another process");
|
|
54
|
+
using (var identity = WindowsIdentity.GetCurrent()) {
|
|
55
|
+
// Retain local administrative access and explicitly admit this account's desktop token.
|
|
56
|
+
// Keep other users, low-integrity processes and network logons out.
|
|
57
|
+
var descriptor = new RawSecurityDescriptor("D:P(D;;GA;;;NU)(A;;GA;;;SY)(A;;GA;;;BA)(A;;GA;;;" +
|
|
58
|
+
identity.User.Value + ")S:(ML;;NW;;;ME)");
|
|
59
|
+
var data = new byte[descriptor.BinaryLength];
|
|
60
|
+
descriptor.GetBinaryForm(data, 0);
|
|
61
|
+
if (!SetKernelObjectSecurity(pipe.SafePipeHandle, 0x80000014, data))
|
|
62
|
+
throw new Win32Exception(Marshal.GetLastWin32Error());
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return 0;
|
|
66
|
+
} catch (Exception error) {
|
|
67
|
+
Console.Error.WriteLine("Cannot secure local pipe: " + error.Message);
|
|
68
|
+
return 1;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
`;
|
|
73
|
+
var helperPath;
|
|
74
|
+
function permissionHelper() {
|
|
75
|
+
if (helperPath) return helperPath;
|
|
76
|
+
const directory = join(homedir(), ".dev-anywhere", "helpers");
|
|
77
|
+
const digest = createHash("sha256").update(SOURCE).digest("hex").slice(0, 20);
|
|
78
|
+
const executable = join(directory, `pipe-permissions-${digest}.exe`);
|
|
79
|
+
if (!existsSync(executable)) {
|
|
80
|
+
mkdirSync(directory, { recursive: true });
|
|
81
|
+
const candidate = `${executable}.${process.pid}.tmp.exe`;
|
|
82
|
+
const script = `$ErrorActionPreference = 'Stop';
|
|
83
|
+
$env:PSModulePath = $PSHOME + '\\Modules';
|
|
84
|
+
$source = [Text.Encoding]::UTF8.GetString([Convert]::FromBase64String('${Buffer.from(SOURCE).toString("base64")}'));
|
|
85
|
+
$output = [Text.Encoding]::UTF8.GetString([Convert]::FromBase64String('${Buffer.from(candidate).toString("base64")}'));
|
|
86
|
+
Add-Type -TypeDefinition $source -ReferencedAssemblies 'System.dll','System.Core.dll' -OutputAssembly $output -OutputType ConsoleApplication;`;
|
|
87
|
+
try {
|
|
88
|
+
execFileSync(
|
|
89
|
+
join(
|
|
90
|
+
process.env.SystemRoot ?? "C:\\Windows",
|
|
91
|
+
"System32",
|
|
92
|
+
"WindowsPowerShell",
|
|
93
|
+
"v1.0",
|
|
94
|
+
"powershell.exe"
|
|
95
|
+
),
|
|
96
|
+
[
|
|
97
|
+
"-NoProfile",
|
|
98
|
+
"-NonInteractive",
|
|
99
|
+
"-EncodedCommand",
|
|
100
|
+
Buffer.from(script, "utf16le").toString("base64")
|
|
101
|
+
],
|
|
102
|
+
{ timeout: 3e4, windowsHide: true, stdio: "pipe" }
|
|
103
|
+
);
|
|
104
|
+
try {
|
|
105
|
+
renameSync(candidate, executable);
|
|
106
|
+
} catch (error) {
|
|
107
|
+
if (!existsSync(executable)) throw error;
|
|
108
|
+
}
|
|
109
|
+
} finally {
|
|
110
|
+
rmSync(candidate, { force: true });
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
helperPath = executable;
|
|
114
|
+
return executable;
|
|
115
|
+
}
|
|
116
|
+
function setWindowsPipePermissions(endpoint) {
|
|
117
|
+
execFileSync(permissionHelper(), [endpoint, String(process.pid)], {
|
|
118
|
+
timeout: 5e3,
|
|
119
|
+
windowsHide: true,
|
|
120
|
+
stdio: "pipe"
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// src/common/local-ipc-endpoint.ts
|
|
125
|
+
function isNamedPipeEndpoint(endpoint) {
|
|
126
|
+
return /^\\\\[.?]\\pipe\\/i.test(endpoint);
|
|
127
|
+
}
|
|
128
|
+
function prepareLocalIpcEndpoint(endpoint) {
|
|
129
|
+
if (!isNamedPipeEndpoint(endpoint)) mkdirSync2(dirname(endpoint), { recursive: true });
|
|
130
|
+
}
|
|
131
|
+
function setLocalIpcEndpointPermissions(endpoint) {
|
|
132
|
+
if (isNamedPipeEndpoint(endpoint)) setWindowsPipePermissions(endpoint);
|
|
133
|
+
else chmodSync(endpoint, 384);
|
|
134
|
+
}
|
|
135
|
+
function removeLocalIpcEndpoint(endpoint) {
|
|
136
|
+
if (!isNamedPipeEndpoint(endpoint)) unlinkIfPresent(endpoint);
|
|
137
|
+
}
|
|
138
|
+
function localIpcEndpointMayExist(endpoint) {
|
|
139
|
+
return isNamedPipeEndpoint(endpoint) || existsSync2(endpoint);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export {
|
|
143
|
+
unlinkIfPresent,
|
|
144
|
+
prepareLocalIpcEndpoint,
|
|
145
|
+
setLocalIpcEndpointPermissions,
|
|
146
|
+
removeLocalIpcEndpoint,
|
|
147
|
+
localIpcEndpointMayExist
|
|
148
|
+
};
|
|
149
|
+
//# sourceMappingURL=chunk-G4QN6LOR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common/local-ipc-endpoint.ts","../src/common/safe-unlink.ts","../src/common/windows-pipe-permissions.ts"],"sourcesContent":["import { chmodSync, existsSync, mkdirSync } from \"node:fs\";\nimport { dirname } from \"node:path\";\nimport { unlinkIfPresent } from \"./safe-unlink.js\";\nimport { setWindowsPipePermissions } from \"./windows-pipe-permissions.js\";\n\nexport function isNamedPipeEndpoint(endpoint: string): boolean {\n return /^\\\\\\\\[.?]\\\\pipe\\\\/i.test(endpoint);\n}\n\nexport function prepareLocalIpcEndpoint(endpoint: string): void {\n if (!isNamedPipeEndpoint(endpoint)) mkdirSync(dirname(endpoint), { recursive: true });\n}\n\nexport function setLocalIpcEndpointPermissions(endpoint: string): void {\n // Do not enable readableAll/writableAll: access must stay limited to this account.\n // Listeners must not send data until the client writes and passes protocol admission.\n if (isNamedPipeEndpoint(endpoint)) setWindowsPipePermissions(endpoint);\n else chmodSync(endpoint, 0o600);\n}\n\nexport function removeLocalIpcEndpoint(endpoint: string): void {\n // Windows removes the pipe when its final handle closes. Unlink cannot remove a pipe.\n if (!isNamedPipeEndpoint(endpoint)) unlinkIfPresent(endpoint);\n}\n\n/** A cheap scan filter, not a liveness check. Named pipes must always be probed by connecting. */\nexport function localIpcEndpointMayExist(endpoint: string): boolean {\n return isNamedPipeEndpoint(endpoint) || existsSync(endpoint);\n}\n","import { unlinkSync } from \"node:fs\";\n\ntype UnlinkFn = (path: string) => void;\n\nexport function unlinkIfPresent(path: string, unlink: UnlinkFn = unlinkSync): void {\n try {\n unlink(path);\n } catch (err) {\n if ((err as NodeJS.ErrnoException).code === \"ENOENT\") return;\n throw err;\n }\n}\n","import { execFileSync } from \"node:child_process\";\nimport { createHash } from \"node:crypto\";\nimport { existsSync, mkdirSync, renameSync, rmSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { join } from \"node:path\";\n\n// An administrator's service token makes Administrators the default pipe owner. Its\n// unelevated desktop token cannot use that ACE. Grant the actual user SID explicitly.\nconst SOURCE = `using System;\nusing System.ComponentModel;\nusing System.IO;\nusing System.IO.Pipes;\nusing System.Runtime.InteropServices;\nusing System.Security.AccessControl;\nusing System.Security.Principal;\nusing Microsoft.Win32.SafeHandles;\n\npublic static class DevAnywherePipePermissions {\n [DllImport(\"kernel32.dll\", SetLastError = true)]\n private static extern bool GetNamedPipeServerProcessId(SafePipeHandle pipe, out uint pid);\n [DllImport(\"advapi32.dll\", SetLastError = true)]\n private static extern bool SetKernelObjectSecurity(SafePipeHandle handle, uint information, byte[] descriptor);\n\n public static int Main(string[] args) {\n Console.OutputEncoding = new System.Text.UTF8Encoding(false);\n try {\n if (args.Length != 2 || !(args[0].StartsWith(@\"\\\\\\\\.\\\\pipe\\\\\") || args[0].StartsWith(@\"\\\\\\\\?\\\\pipe\\\\\")))\n throw new ArgumentException(\"Expected a local named pipe and its server PID\");\n uint expectedPid = uint.Parse(args[1]);\n var rights = PipeAccessRights.ReadWrite | PipeAccessRights.ReadPermissions |\n PipeAccessRights.ChangePermissions | PipeAccessRights.TakeOwnership;\n using (var pipe = new NamedPipeClientStream(\".\", args[0].Substring(9), rights,\n PipeOptions.None, TokenImpersonationLevel.Identification, HandleInheritability.None)) {\n pipe.Connect(3000);\n uint serverPid;\n if (!GetNamedPipeServerProcessId(pipe.SafePipeHandle, out serverPid))\n throw new Win32Exception(Marshal.GetLastWin32Error());\n if (serverPid != expectedPid) throw new InvalidOperationException(\"Named pipe belongs to another process\");\n using (var identity = WindowsIdentity.GetCurrent()) {\n // Retain local administrative access and explicitly admit this account's desktop token.\n // Keep other users, low-integrity processes and network logons out.\n var descriptor = new RawSecurityDescriptor(\"D:P(D;;GA;;;NU)(A;;GA;;;SY)(A;;GA;;;BA)(A;;GA;;;\" +\n identity.User.Value + \")S:(ML;;NW;;;ME)\");\n var data = new byte[descriptor.BinaryLength];\n descriptor.GetBinaryForm(data, 0);\n if (!SetKernelObjectSecurity(pipe.SafePipeHandle, 0x80000014, data))\n throw new Win32Exception(Marshal.GetLastWin32Error());\n }\n }\n return 0;\n } catch (Exception error) {\n Console.Error.WriteLine(\"Cannot secure local pipe: \" + error.Message);\n return 1;\n }\n }\n}\n`;\n\nlet helperPath: string | undefined;\n\nfunction permissionHelper(): string {\n if (helperPath) return helperPath;\n const directory = join(homedir(), \".dev-anywhere\", \"helpers\");\n const digest = createHash(\"sha256\").update(SOURCE).digest(\"hex\").slice(0, 20);\n const executable = join(directory, `pipe-permissions-${digest}.exe`);\n if (!existsSync(executable)) {\n mkdirSync(directory, { recursive: true });\n const candidate = `${executable}.${process.pid}.tmp.exe`;\n const script = `$ErrorActionPreference = 'Stop';\n$env:PSModulePath = $PSHOME + '\\\\Modules';\n$source = [Text.Encoding]::UTF8.GetString([Convert]::FromBase64String('${Buffer.from(SOURCE).toString(\"base64\")}'));\n$output = [Text.Encoding]::UTF8.GetString([Convert]::FromBase64String('${Buffer.from(candidate).toString(\"base64\")}'));\nAdd-Type -TypeDefinition $source -ReferencedAssemblies 'System.dll','System.Core.dll' -OutputAssembly $output -OutputType ConsoleApplication;`;\n try {\n execFileSync(\n join(\n process.env.SystemRoot ?? \"C:\\\\Windows\",\n \"System32\",\n \"WindowsPowerShell\",\n \"v1.0\",\n \"powershell.exe\",\n ),\n [\n \"-NoProfile\",\n \"-NonInteractive\",\n \"-EncodedCommand\",\n Buffer.from(script, \"utf16le\").toString(\"base64\"),\n ],\n { timeout: 30_000, windowsHide: true, stdio: \"pipe\" },\n );\n try {\n renameSync(candidate, executable);\n } catch (error) {\n // Another process can finish compiling the same source first.\n if (!existsSync(executable)) throw error;\n }\n } finally {\n rmSync(candidate, { force: true });\n }\n }\n helperPath = executable;\n return executable;\n}\n\nexport function setWindowsPipePermissions(endpoint: string): void {\n execFileSync(permissionHelper(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sSync","mkdirSync","mkdirSync","existsSync"]}
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
} from "./chunk-HJOYOYGB.js";
|
|
39
39
|
import {
|
|
40
40
|
terminalLogger
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-WTCJIDDT.js";
|
|
42
42
|
|
|
43
43
|
// src/terminal-worker-args.ts
|
|
44
44
|
import { z } from "zod";
|
|
@@ -358,4 +358,4 @@ export {
|
|
|
358
358
|
buildHostedPtyArgs,
|
|
359
359
|
PtyRuntime
|
|
360
360
|
};
|
|
361
|
-
//# sourceMappingURL=chunk-
|
|
361
|
+
//# sourceMappingURL=chunk-UEIKYXS7.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
setLocalIpcEndpointPermissions
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-G4QN6LOR.js";
|
|
5
5
|
|
|
6
6
|
// src/common/service-control.ts
|
|
7
7
|
import { connect, createServer } from "net";
|
|
@@ -207,4 +207,4 @@ export {
|
|
|
207
207
|
requestServiceControl,
|
|
208
208
|
startServiceControl
|
|
209
209
|
};
|
|
210
|
-
//# sourceMappingURL=chunk-
|
|
210
|
+
//# sourceMappingURL=chunk-VYAEW7G6.js.map
|
|
@@ -38,11 +38,22 @@ function parsePort(value, source) {
|
|
|
38
38
|
function nonEmpty(value) {
|
|
39
39
|
return value && value.length > 0 ? value : void 0;
|
|
40
40
|
}
|
|
41
|
+
function parseRetryInterval(value) {
|
|
42
|
+
if (!value) return void 0;
|
|
43
|
+
const interval = Number(value);
|
|
44
|
+
if (!Number.isInteger(interval) || interval < 1 || interval > 2147483647) {
|
|
45
|
+
throw new Error(
|
|
46
|
+
`Invalid DEV_ANYWHERE_AUTO_UPDATE_RETRY_INITIAL_MS=${JSON.stringify(value)}: expected integer milliseconds 1-2147483647`
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
return interval;
|
|
50
|
+
}
|
|
41
51
|
function loadProxyRuntimeEnv(env2 = process.env) {
|
|
42
52
|
return {
|
|
43
53
|
relayUrl: nonEmpty(env2.RELAY_URL),
|
|
44
54
|
relayProxyToken: nonEmpty(env2.RELAY_PROXY_TOKEN),
|
|
45
55
|
hookPort: parsePort(env2.DEV_ANYWHERE_HOOK_PORT, "DEV_ANYWHERE_HOOK_PORT"),
|
|
56
|
+
autoUpdateRetryInitialMs: parseRetryInterval(env2.DEV_ANYWHERE_AUTO_UPDATE_RETRY_INITIAL_MS),
|
|
46
57
|
claudeBin: nonEmpty(env2.CLAUDE_BIN),
|
|
47
58
|
codexBin: nonEmpty(env2.CODEX_BIN),
|
|
48
59
|
kimiBin: nonEmpty(env2.KIMI_BIN),
|
|
@@ -92,4 +103,4 @@ export {
|
|
|
92
103
|
terminalLogger,
|
|
93
104
|
autoUpdateLogger
|
|
94
105
|
};
|
|
95
|
-
//# sourceMappingURL=chunk-
|
|
106
|
+
//# sourceMappingURL=chunk-WTCJIDDT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common/logger.ts","../src/common/runtime-env.ts"],"sourcesContent":["import { existsSync, readFileSync } from \"node:fs\";\nimport { createLogger } from \"@dev-anywhere/shared/logger\";\nimport { CONFIG_PATH, LOG_DIR } from \"./paths.js\";\nimport { loadProxyRuntimeEnv, VALID_LOG_LEVELS } from \"./runtime-env.js\";\n\nconst env = loadProxyRuntimeEnv();\n\n// 直接读 config.json 而不走 config.ts loadConfig:loadConfig 依赖 logger.ts,\n// 反向引用会形成循环。这里只取 logLevel 字段做 best-effort 降级,全量 schema 校验仍由\n// config.ts 在第一次 loadConfig 时执行。\nfunction readConfigLogLevel(): string | undefined {\n if (env.logLevel) return undefined;\n if (!existsSync(CONFIG_PATH)) return undefined;\n try {\n const raw = JSON.parse(readFileSync(CONFIG_PATH, \"utf-8\")) as { logLevel?: unknown };\n if (typeof raw.logLevel !== \"string\") return undefined;\n return (VALID_LOG_LEVELS as readonly string[]).includes(raw.logLevel)\n ? raw.logLevel\n : undefined;\n } catch {\n return undefined;\n }\n}\n\n// 三级 precedence:LOG_LEVEL env > config.logLevel > 各 logger 自己的默认。\nconst overrideLevel = env.logLevel ?? readConfigLogLevel();\nconst isPreviewWorker = process.env.DEV_ANYWHERE_PROCESS_ROLE === \"preview-worker\";\n\nexport const serviceLogger = createLogger({\n name: isPreviewWorker ? \"preview-worker\" : \"service\",\n level: overrideLevel ?? \"info\",\n logDir: LOG_DIR,\n silent: env.isVitest,\n});\n\n// A detached preview worker must not create unrelated files or replace their latest symlinks.\nexport const terminalLogger = isPreviewWorker\n ? serviceLogger\n : createLogger({\n name: \"terminal\",\n level: overrideLevel ?? \"debug\",\n logDir: LOG_DIR,\n silent: env.isVitest,\n });\n\n// 自动升级器会跨 daemon 重启继续运行,使用独立日志名,避免它创建 logger 时把\n// service.log 的 latest symlink 抢走,导致用户正在 tail 的服务日志突然切文件。\nexport const autoUpdateLogger = isPreviewWorker\n ? serviceLogger\n : createLogger({\n name: \"auto-update\",\n level: overrideLevel ?? \"info\",\n logDir: LOG_DIR,\n silent: env.isVitest,\n });\n","// 单一入口集中读取 proxy 运行时关心的环境变量,类型化输出,避免 process.env.X\n// 散落在多个文件里各自做 parseInt / 空串判断 / undefined 兜底。\n//\n// 范围:用户面对的运行时旋钮 + 构建/测试模式标志。\n// 不包含:proxy → provider/hook 子进程之间的 plumbing(DEV_ANYWHERE_HOOK_TOKEN /\n// HOOK_URL / HOOK_MARKER / HOOK_EVENT / SESSION_ID 等),这些是内部传参,不是用户旋钮,\n// 留在各自消费点。\n\nexport const VALID_LOG_LEVELS = [\n \"trace\",\n \"debug\",\n \"info\",\n \"warn\",\n \"error\",\n \"fatal\",\n \"silent\",\n] as const;\nexport type LogLevel = (typeof VALID_LOG_LEVELS)[number];\n\ninterface ProxyRuntimeEnv {\n // RELAY_URL —— 覆盖 config.relays[name].url;用于一次性指向另一个 relay。\n relayUrl: string | undefined;\n // RELAY_PROXY_TOKEN —— 覆盖 config.relays[name].proxyToken。\n relayProxyToken: string | undefined;\n // DEV_ANYWHERE_HOOK_PORT —— 覆盖按 profile 推导的 hook server 端口。\n hookPort: number | undefined;\n // DEV_ANYWHERE_AUTO_UPDATE_RETRY_INITIAL_MS —— 自动更新失败后的首次重试间隔。\n autoUpdateRetryInitialMs: number | undefined;\n // CLAUDE_BIN / CODEX_BIN / KIMI_BIN —— 覆盖 config.agentCli 里的 CLI 可执行文件路径。\n claudeBin: string | undefined;\n codexBin: string | undefined;\n kimiBin: string | undefined;\n // LOG_LEVEL —— 用户最高优先级;config.logLevel 是次优先;都缺则各 logger 自己 default。\n logLevel: LogLevel | undefined;\n // VITEST —— 测试运行器存在则把 logger 静默,避免污染 vitest 输出。\n isVitest: boolean;\n // NODE_ENV 故意不在这里:env.ts 把它读成 top-level const 让 tsup 静态折叠 + dead-code\n // elimination dev 分支。走函数调用会破坏这个 build-time 优化。\n}\n\nfunction parseLogLevel(value: string | undefined): LogLevel | undefined {\n if (!value) return undefined;\n if ((VALID_LOG_LEVELS as readonly string[]).includes(value)) return value as LogLevel;\n throw new Error(\n `Invalid LOG_LEVEL=${JSON.stringify(value)}; expected one of ${VALID_LOG_LEVELS.join(\", \")}`,\n );\n}\n\nfunction parsePort(value: string | undefined, source: string): number | undefined {\n if (!value) return undefined;\n const port = Number(value);\n if (!Number.isInteger(port) || port < 1 || port > 65535) {\n throw new Error(`Invalid ${source}=${JSON.stringify(value)}: expected TCP port 1-65535`);\n }\n return port;\n}\n\nfunction nonEmpty(value: string | undefined): string | undefined {\n return value && value.length > 0 ? value : undefined;\n}\n\nfunction parseRetryInterval(value: string | undefined): number | undefined {\n if (!value) return undefined;\n const interval = Number(value);\n if (!Number.isInteger(interval) || interval < 1 || interval > 2_147_483_647) {\n throw new Error(\n `Invalid DEV_ANYWHERE_AUTO_UPDATE_RETRY_INITIAL_MS=${JSON.stringify(value)}: expected integer milliseconds 1-2147483647`,\n );\n }\n return interval;\n}\n\nexport function loadProxyRuntimeEnv(env: NodeJS.ProcessEnv = process.env): ProxyRuntimeEnv {\n return {\n relayUrl: nonEmpty(env.RELAY_URL),\n relayProxyToken: nonEmpty(env.RELAY_PROXY_TOKEN),\n hookPort: parsePort(env.DEV_ANYWHERE_HOOK_PORT, \"DEV_ANYWHERE_HOOK_PORT\"),\n autoUpdateRetryInitialMs: parseRetryInterval(env.DEV_ANYWHERE_AUTO_UPDATE_RETRY_INITIAL_MS),\n claudeBin: nonEmpty(env.CLAUDE_BIN),\n codexBin: nonEmpty(env.CODEX_BIN),\n kimiBin: nonEmpty(env.KIMI_BIN),\n logLevel: parseLogLevel(env.LOG_LEVEL),\n isVitest: !!env.VITEST,\n };\n}\n"],"mappings":";;;;;;;;;;AAAA,SAAS,YAAY,oBAAoB;;;ACQlC,IAAM,mBAAmB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAwBA,SAAS,cAAc,OAAiD;AACtE,MAAI,CAAC,MAAO,QAAO;AACnB,MAAK,iBAAuC,SAAS,KAAK,EAAG,QAAO;AACpE,QAAM,IAAI;AAAA,IACR,qBAAqB,KAAK,UAAU,KAAK,CAAC,qBAAqB,iBAAiB,KAAK,IAAI,CAAC;AAAA,EAC5F;AACF;AAEA,SAAS,UAAU,OAA2B,QAAoC;AAChF,MAAI,CAAC,MAAO,QAAO;AACnB,QAAM,OAAO,OAAO,KAAK;AACzB,MAAI,CAAC,OAAO,UAAU,IAAI,KAAK,OAAO,KAAK,OAAO,OAAO;AACvD,UAAM,IAAI,MAAM,WAAW,MAAM,IAAI,KAAK,UAAU,KAAK,CAAC,6BAA6B;AAAA,EACzF;AACA,SAAO;AACT;AAEA,SAAS,SAAS,OAA+C;AAC/D,SAAO,SAAS,MAAM,SAAS,IAAI,QAAQ;AAC7C;AAEA,SAAS,mBAAmB,OAA+C;AACzE,MAAI,CAAC,MAAO,QAAO;AACnB,QAA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,MAAM;AAAA,EACN,OAAO,iBAAiB;AAAA,EACxB,QAAQ;AAAA,EACR,QAAQ,IAAI;AACd,CAAC;AAIE,IAAM,mBAAmB,kBAC5B,gBACA,aAAa;AAAA,EACX,MAAM;AAAA,EACN,OAAO,iBAAiB;AAAA,EACxB,QAAQ;AAAA,EACR,QAAQ,IAAI;AACd,CAAC;","names":["env"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
setLocalIpcEndpointPermissions
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-G4QN6LOR.js";
|
|
5
5
|
import {
|
|
6
6
|
parseServiceCommandResult
|
|
7
7
|
} from "./chunk-ZRCMGVGT.js";
|
|
@@ -158,4 +158,4 @@ export {
|
|
|
158
158
|
requestServiceHost,
|
|
159
159
|
startServiceHostControl
|
|
160
160
|
};
|
|
161
|
-
//# sourceMappingURL=chunk-
|
|
161
|
+
//# sourceMappingURL=chunk-YNDDXMND.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
requestServiceHost
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YNDDXMND.js";
|
|
5
5
|
import {
|
|
6
6
|
requestServiceControl
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-VYAEW7G6.js";
|
|
8
8
|
import {
|
|
9
9
|
spawnScript
|
|
10
10
|
} from "./chunk-AS7W2D2X.js";
|
|
@@ -456,4 +456,4 @@ export {
|
|
|
456
456
|
ServiceLifecycleError,
|
|
457
457
|
createProfileServiceLifecycle
|
|
458
458
|
};
|
|
459
|
-
//# sourceMappingURL=chunk-
|
|
459
|
+
//# sourceMappingURL=chunk-Z2KUJ6SW.js.map
|
package/dist/index.js
CHANGED
|
@@ -19,11 +19,11 @@ import {
|
|
|
19
19
|
ServiceLifecycleError,
|
|
20
20
|
createProfileServiceLifecycle,
|
|
21
21
|
setDesiredDaemonRelay
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-Z2KUJ6SW.js";
|
|
23
23
|
import {
|
|
24
24
|
requestServiceHost
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import "./chunk-
|
|
25
|
+
} from "./chunk-YNDDXMND.js";
|
|
26
|
+
import "./chunk-VYAEW7G6.js";
|
|
27
27
|
import "./chunk-AS7W2D2X.js";
|
|
28
28
|
import "./chunk-3NUN2VYO.js";
|
|
29
29
|
import "./chunk-CFO5GU5U.js";
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
WORKER_IPC_PROTOCOL_VERSION
|
|
33
33
|
} from "./chunk-3ZDUDCEI.js";
|
|
34
34
|
import "./chunk-5KXGIGKU.js";
|
|
35
|
-
import "./chunk-
|
|
35
|
+
import "./chunk-G4QN6LOR.js";
|
|
36
36
|
import {
|
|
37
37
|
PROXY_VERSION
|
|
38
38
|
} from "./chunk-EGNWMOPC.js";
|
|
@@ -253,7 +253,7 @@ var program = new Command("dev-anywhere").description("Dev Anywhere - transparen
|
|
|
253
253
|
console.error(err instanceof Error ? err.message : String(err));
|
|
254
254
|
process.exit(1);
|
|
255
255
|
}
|
|
256
|
-
const { startTerminal } = await import("./terminal-
|
|
256
|
+
const { startTerminal } = await import("./terminal-7ZS7U6OX.js");
|
|
257
257
|
const { provider, args } = invocation;
|
|
258
258
|
await startTerminal(args, provider);
|
|
259
259
|
});
|
|
@@ -309,12 +309,12 @@ for (const [action, description] of [
|
|
|
309
309
|
["status", "Show automatic startup status"]
|
|
310
310
|
]) {
|
|
311
311
|
autostart.command(action).description(description).option("--system", "Use a system service that runs without desktop login").option("--now", "Start the system service now and restart Proxy (enable --system only)").action(async (options) => {
|
|
312
|
-
const { runAutostartCommand } = await import("./autostart-
|
|
312
|
+
const { runAutostartCommand } = await import("./autostart-RRSXYZND.js");
|
|
313
313
|
await runAutostartCommand(action, options);
|
|
314
314
|
});
|
|
315
315
|
}
|
|
316
316
|
autostart.command("run", { hidden: true }).option("--daemon", "Detach after service readiness (systemd login trigger)").option("--system", "Run the persistent system service host").action(async (_options, command) => {
|
|
317
|
-
const { startAutostartService } = await import("./autostart-
|
|
317
|
+
const { startAutostartService } = await import("./autostart-RRSXYZND.js");
|
|
318
318
|
const options = command.optsWithGlobals();
|
|
319
319
|
await startAutostartService(Boolean(options.daemon), Boolean(options.system));
|
|
320
320
|
});
|
|
@@ -328,7 +328,7 @@ relay.command("token").description("Print the relay's current client token (auth
|
|
|
328
328
|
console.error(`Dev Anywhere is not initialized. Run "dev-anywhere init" first.`);
|
|
329
329
|
process.exit(1);
|
|
330
330
|
}
|
|
331
|
-
const { runRelayTokenCommand } = await import("./relay-token-
|
|
331
|
+
const { runRelayTokenCommand } = await import("./relay-token-KHOXKEF2.js");
|
|
332
332
|
await runRelayTokenCommand({ relayName: opts.relay });
|
|
333
333
|
});
|
|
334
334
|
program.addCommand(relay);
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
autoUpdateLogger,
|
|
4
4
|
serviceLogger,
|
|
5
5
|
terminalLogger
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-WTCJIDDT.js";
|
|
7
7
|
import "./chunk-SKKPJULC.js";
|
|
8
8
|
import "./chunk-ICSO3ZIS.js";
|
|
9
9
|
export {
|
|
@@ -11,4 +11,4 @@ export {
|
|
|
11
11
|
serviceLogger,
|
|
12
12
|
terminalLogger
|
|
13
13
|
};
|
|
14
|
-
//# sourceMappingURL=logger-
|
|
14
|
+
//# sourceMappingURL=logger-6MR4NSOC.js.map
|
package/dist/preview-worker.js
CHANGED
|
@@ -50,7 +50,7 @@ import {
|
|
|
50
50
|
prepareLocalIpcEndpoint,
|
|
51
51
|
removeLocalIpcEndpoint,
|
|
52
52
|
setLocalIpcEndpointPermissions
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-G4QN6LOR.js";
|
|
54
54
|
import {
|
|
55
55
|
PROXY_PACKAGE_ROOT
|
|
56
56
|
} from "./chunk-EGNWMOPC.js";
|
|
@@ -61,7 +61,7 @@ import {
|
|
|
61
61
|
} from "./chunk-HJOYOYGB.js";
|
|
62
62
|
import {
|
|
63
63
|
serviceLogger
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-WTCJIDDT.js";
|
|
65
65
|
import {
|
|
66
66
|
PREVIEWS_PATH,
|
|
67
67
|
PREVIEW_RUN_DIR,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
loadConfig
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-4EIUH7CQ.js";
|
|
5
5
|
import "./chunk-NQDJ6QAM.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-WTCJIDDT.js";
|
|
7
7
|
import "./chunk-SKKPJULC.js";
|
|
8
8
|
import "./chunk-ICSO3ZIS.js";
|
|
9
9
|
|
|
@@ -81,4 +81,4 @@ function printResult(relayName, relayUrl, result) {
|
|
|
81
81
|
export {
|
|
82
82
|
runRelayTokenCommand
|
|
83
83
|
};
|
|
84
|
-
//# sourceMappingURL=relay-token-
|
|
84
|
+
//# sourceMappingURL=relay-token-KHOXKEF2.js.map
|
package/dist/serve.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
buildProviderEnv,
|
|
4
4
|
loadConfig,
|
|
5
5
|
saveAgentCliPath
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4EIUH7CQ.js";
|
|
7
7
|
import {
|
|
8
8
|
PersistedSessionRecordSchema,
|
|
9
9
|
extractAgentInvocation,
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
import {
|
|
41
41
|
buildHostedPtyArgs,
|
|
42
42
|
parseTerminalWorkerCliArgs
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-UEIKYXS7.js";
|
|
44
44
|
import {
|
|
45
45
|
ReconnectSupervisor,
|
|
46
46
|
TERMINAL_ADMISSION_FRAME_MAX_BYTES,
|
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
} from "./chunk-DSZJSFEG.js";
|
|
52
52
|
import {
|
|
53
53
|
startServiceControl
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-VYAEW7G6.js";
|
|
55
55
|
import {
|
|
56
56
|
IS_DEV,
|
|
57
57
|
spawnScript
|
|
@@ -111,7 +111,7 @@ import {
|
|
|
111
111
|
removeLocalIpcEndpoint,
|
|
112
112
|
setLocalIpcEndpointPermissions,
|
|
113
113
|
unlinkIfPresent
|
|
114
|
-
} from "./chunk-
|
|
114
|
+
} from "./chunk-G4QN6LOR.js";
|
|
115
115
|
import {
|
|
116
116
|
compareStableVersions,
|
|
117
117
|
selectHighestStableVersion
|
|
@@ -131,8 +131,9 @@ import {
|
|
|
131
131
|
isExecutableFile
|
|
132
132
|
} from "./chunk-HJOYOYGB.js";
|
|
133
133
|
import {
|
|
134
|
+
loadProxyRuntimeEnv,
|
|
134
135
|
serviceLogger
|
|
135
|
-
} from "./chunk-
|
|
136
|
+
} from "./chunk-WTCJIDDT.js";
|
|
136
137
|
import {
|
|
137
138
|
DATA_DIR,
|
|
138
139
|
DEFAULT_PROXY_PROFILE,
|
|
@@ -9158,7 +9159,7 @@ var UPDATE_UNSUPPORTED_EXIT_CODE = 64;
|
|
|
9158
9159
|
function createRelayAutoUpdater(options) {
|
|
9159
9160
|
const packagedRuntime = options.packagedRuntime ?? !IS_DEV;
|
|
9160
9161
|
const available = options.enabled && packagedRuntime && options.profileName !== QUICK_TUNNEL_PROFILE;
|
|
9161
|
-
const retryInitialMs = options.retryInitialMs ?? UPDATE_RETRY_INITIAL_MS;
|
|
9162
|
+
const retryInitialMs = options.retryInitialMs ?? loadProxyRuntimeEnv().autoUpdateRetryInitialMs ?? UPDATE_RETRY_INITIAL_MS;
|
|
9162
9163
|
const retryMaxMs = options.retryMaxMs ?? UPDATE_RETRY_MAX_MS;
|
|
9163
9164
|
const spawnRunner = options.spawnRunner ?? ((args) => spawnScript("update-runner", args, {
|
|
9164
9165
|
env: { ...process.env },
|