@dev-anywhere/proxy 0.9.4 → 0.9.5

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.
Files changed (39) hide show
  1. package/dist/{autostart-G2MSOPL7.js → autostart-XIZTTKSV.js} +96 -22
  2. package/dist/autostart-XIZTTKSV.js.map +1 -0
  3. package/dist/{chunk-GIFG7KAJ.js → chunk-3KATRUOJ.js} +3 -1
  4. package/dist/chunk-3KATRUOJ.js.map +1 -0
  5. package/dist/{chunk-M34C6LTF.js → chunk-4TXAGHXH.js} +13 -5
  6. package/dist/chunk-4TXAGHXH.js.map +1 -0
  7. package/dist/{chunk-2YUDGRJ6.js → chunk-L2DA7PGQ.js} +2 -2
  8. package/dist/{chunk-HYDXGNKA.js → chunk-N63J6URN.js} +2 -2
  9. package/dist/{chunk-YK2XKOP4.js → chunk-POTR6UPA.js} +2 -1
  10. package/dist/{chunk-YYNHKGCH.js → chunk-Q6EYYC4Z.js} +2 -2
  11. package/dist/{chunk-EIXVJR3C.js → chunk-QWHC5PEP.js} +4 -4
  12. package/dist/{chunk-GYL5JKWQ.js → chunk-R4SLOZKJ.js} +3 -3
  13. package/dist/{chunk-KWODOJBK.js → chunk-T7N6ALSP.js} +2 -2
  14. package/dist/{chunk-QZ3OZJBG.js → chunk-TMY2OA3C.js} +2 -2
  15. package/dist/index.js +8 -8
  16. package/dist/{logger-B7B64O4P.js → logger-NB7VSWM5.js} +3 -3
  17. package/dist/{relay-token-N3BSBURG.js → relay-token-DJX6KWOT.js} +4 -4
  18. package/dist/serve.js +84 -17
  19. package/dist/serve.js.map +1 -1
  20. package/dist/session-worker.js +4 -4
  21. package/dist/{terminal-UTFRKKZ4.js → terminal-ZAWO3GKY.js} +7 -7
  22. package/dist/terminal-worker.js +14 -13
  23. package/dist/terminal-worker.js.map +1 -1
  24. package/dist/update-runner.js +2 -2
  25. package/package.json +3 -3
  26. package/dist/autostart-G2MSOPL7.js.map +0 -1
  27. package/dist/chunk-GIFG7KAJ.js.map +0 -1
  28. package/dist/chunk-M34C6LTF.js.map +0 -1
  29. /package/dist/{chunk-2YUDGRJ6.js.map → chunk-L2DA7PGQ.js.map} +0 -0
  30. /package/dist/{chunk-HYDXGNKA.js.map → chunk-N63J6URN.js.map} +0 -0
  31. /package/dist/{chunk-YK2XKOP4.js.map → chunk-POTR6UPA.js.map} +0 -0
  32. /package/dist/{chunk-YYNHKGCH.js.map → chunk-Q6EYYC4Z.js.map} +0 -0
  33. /package/dist/{chunk-EIXVJR3C.js.map → chunk-QWHC5PEP.js.map} +0 -0
  34. /package/dist/{chunk-GYL5JKWQ.js.map → chunk-R4SLOZKJ.js.map} +0 -0
  35. /package/dist/{chunk-KWODOJBK.js.map → chunk-T7N6ALSP.js.map} +0 -0
  36. /package/dist/{chunk-QZ3OZJBG.js.map → chunk-TMY2OA3C.js.map} +0 -0
  37. /package/dist/{logger-B7B64O4P.js.map → logger-NB7VSWM5.js.map} +0 -0
  38. /package/dist/{relay-token-N3BSBURG.js.map → relay-token-DJX6KWOT.js.map} +0 -0
  39. /package/dist/{terminal-UTFRKKZ4.js.map → terminal-ZAWO3GKY.js.map} +0 -0
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-XADKKDUV.js";
6
6
  import {
7
7
  createProfileServiceLifecycle
8
- } from "./chunk-2YUDGRJ6.js";
8
+ } from "./chunk-L2DA7PGQ.js";
9
9
  import "./chunk-DAFUSBKJ.js";
10
10
  import {
11
11
  IS_DEV,
@@ -17,8 +17,9 @@ import {
17
17
  } from "./chunk-CMADETTC.js";
18
18
  import {
19
19
  PROFILE_NAME,
20
+ buildProxyProfilePaths,
20
21
  isInitialized
21
- } from "./chunk-YK2XKOP4.js";
22
+ } from "./chunk-POTR6UPA.js";
22
23
 
23
24
  // src/autostart.ts
24
25
  import { homedir, userInfo } from "os";
@@ -26,10 +27,93 @@ import { fileURLToPath } from "url";
26
27
 
27
28
  // src/common/service-autostart.ts
28
29
  import { execFile } from "child_process";
29
- import { createHash } from "crypto";
30
+ import { createHash as createHash2 } from "crypto";
30
31
  import { mkdir, readFile, unlink, writeFile } from "fs/promises";
31
- import { dirname, join, win32 } from "path";
32
+ import { dirname, join, win32 as win322 } from "path";
32
33
  import { promisify } from "util";
34
+
35
+ // src/common/windows-autostart-launcher.ts
36
+ import { createHash } from "crypto";
37
+ import { win32 } from "path";
38
+ function encodedString(value) {
39
+ if ([...value].some((char) => char.charCodeAt(0) <= 31 || char.charCodeAt(0) === 127)) {
40
+ throw new Error("Autostart paths and environment must not contain control characters");
41
+ }
42
+ return `Decode("${Buffer.from(value, "utf8").toString("base64")}")`;
43
+ }
44
+ function buildWindowsAutostartLauncher(options) {
45
+ const paths = buildProxyProfilePaths(options.home, options.profile, "win32");
46
+ const logPath = win32.join(paths.logDir, "autostart-launcher.log");
47
+ const source = `using System;
48
+ using System.Diagnostics;
49
+ using System.IO;
50
+ using System.Text;
51
+
52
+ internal static class DevAnywhereAutostart {
53
+ private static StreamWriter log;
54
+ private static volatile bool logFailed;
55
+ private static string Decode(string value) { return Encoding.UTF8.GetString(Convert.FromBase64String(value)); }
56
+ private static void WriteLog(string stream, string message) {
57
+ if (message == null) return;
58
+ try { lock (log) { log.WriteLine(DateTime.UtcNow.ToString("o") + " " + stream + ": " + message); } }
59
+ catch { logFailed = true; } // Keep draining output; report logging failures through the task exit code.
60
+ }
61
+ public static int Main() {
62
+ try {
63
+ string logPath = ${encodedString(logPath)};
64
+ Directory.CreateDirectory(Path.GetDirectoryName(logPath));
65
+ using (log = new StreamWriter(new FileStream(logPath, FileMode.Append, FileAccess.Write, FileShare.ReadWrite), new UTF8Encoding(false))) {
66
+ log.AutoFlush = true;
67
+ try {
68
+ var info = new ProcessStartInfo();
69
+ info.FileName = ${encodedString(options.executable)};
70
+ info.Arguments = ${encodedString(options.args.map(quoteWindowsArgument).join(" "))};
71
+ info.WorkingDirectory = ${encodedString(options.home)};
72
+ info.EnvironmentVariables["USERPROFILE"] = ${encodedString(options.home)};
73
+ info.EnvironmentVariables["HOME"] = ${encodedString(options.home)};
74
+ info.UseShellExecute = false;
75
+ info.CreateNoWindow = true;
76
+ info.RedirectStandardInput = true;
77
+ info.RedirectStandardOutput = true;
78
+ info.RedirectStandardError = true;
79
+ info.StandardOutputEncoding = Encoding.UTF8;
80
+ info.StandardErrorEncoding = Encoding.UTF8;
81
+ using (var child = new Process()) {
82
+ child.StartInfo = info;
83
+ child.OutputDataReceived += (sender, e) => WriteLog("stdout", e.Data);
84
+ child.ErrorDataReceived += (sender, e) => WriteLog("stderr", e.Data);
85
+ child.Start();
86
+ child.StandardInput.Close();
87
+ child.BeginOutputReadLine();
88
+ child.BeginErrorReadLine();
89
+ child.WaitForExit();
90
+ return child.ExitCode != 0 ? child.ExitCode : (logFailed ? 1 : 0);
91
+ }
92
+ } catch (Exception error) { WriteLog("launcher", error.ToString()); return 1; }
93
+ }
94
+ } catch { return 1; } // An unwritable log directory is also a failed task, not a silent success.
95
+ }
96
+ }
97
+ `;
98
+ const digest = createHash("sha256").update(source).digest("hex").slice(0, 20);
99
+ const path = win32.join(paths.profileDir, "autostart", `launcher-${digest}.exe`);
100
+ const sourceBase64 = Buffer.from(source, "utf8").toString("base64");
101
+ const compileScript = `$launcherPath = '${path.replaceAll("'", "''")}';
102
+ if (!(Test-Path -LiteralPath $launcherPath -PathType Leaf)) {
103
+ [System.IO.Directory]::CreateDirectory([System.IO.Path]::GetDirectoryName($launcherPath)) | Out-Null;
104
+ $candidate = $launcherPath + '.' + [guid]::NewGuid().ToString('N') + '.tmp.exe';
105
+ try {
106
+ $source = [System.Text.Encoding]::UTF8.GetString([Convert]::FromBase64String('${sourceBase64}'));
107
+ Add-Type -TypeDefinition $source -OutputAssembly $candidate -OutputType WindowsApplication -ErrorAction Stop;
108
+ Move-Item -LiteralPath $candidate -Destination $launcherPath -ErrorAction Stop;
109
+ } finally {
110
+ if (Test-Path -LiteralPath $candidate) { Remove-Item -LiteralPath $candidate -Force; }
111
+ }
112
+ }`;
113
+ return { path, logPath, source, compileScript };
114
+ }
115
+
116
+ // src/common/service-autostart.ts
33
117
  function checkText(value) {
34
118
  if ([...value].some((char) => char.charCodeAt(0) <= 31 || char.charCodeAt(0) === 127)) {
35
119
  throw new Error("Autostart paths and environment must not contain control characters");
@@ -72,7 +156,7 @@ function createServiceAutostart(options) {
72
156
  if (!["darwin", "linux", "win32"].includes(platform)) {
73
157
  throw new Error(`Proxy autostart is not supported on ${platform}`);
74
158
  }
75
- const identity = createHash("sha256").update(`${home}\0${profile}`).digest("hex").slice(0, 20);
159
+ const identity = createHash2("sha256").update(`${home}\0${profile}`).digest("hex").slice(0, 20);
76
160
  const label = `dev-anywhere-${identity}`;
77
161
  const args = [...options.args, "--profile", profile, "serve", "autostart", "run"];
78
162
  const run = options.run ?? (async (command, commandArgs) => {
@@ -84,7 +168,7 @@ function createServiceAutostart(options) {
84
168
  });
85
169
  return result.stdout;
86
170
  });
87
- const powershell = win32.join(
171
+ const powershell = win322.join(
88
172
  env.SystemRoot ?? env.SYSTEMROOT ?? "C:\\Windows",
89
173
  "System32",
90
174
  "WindowsPowerShell",
@@ -140,20 +224,10 @@ WantedBy=default.target
140
224
  `;
141
225
  }
142
226
  function windowsTask() {
143
- const launcher = `$ErrorActionPreference = 'Stop';
144
- $info = New-Object System.Diagnostics.ProcessStartInfo;
145
- $info.FileName = ${psString(executable)};
146
- $info.Arguments = ${psString(args.map(quoteWindowsArgument).join(" "))};
147
- $info.WorkingDirectory = ${psString(home)};
148
- $info.EnvironmentVariables['USERPROFILE'] = ${psString(home)};
149
- $info.EnvironmentVariables['HOME'] = ${psString(home)};
150
- $info.UseShellExecute = $false;
151
- $info.CreateNoWindow = $true;
152
- $child = [System.Diagnostics.Process]::Start($info);
153
- $child.WaitForExit();
154
- exit $child.ExitCode;`;
155
- return `$user = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name;
156
- $action = New-ScheduledTaskAction -Execute ${psString(powershell)} -Argument ${psString(`-NoProfile -NonInteractive -WindowStyle Hidden -EncodedCommand ${encodePowerShell(launcher)}`)};
227
+ const launcher = buildWindowsAutostartLauncher({ home, profile, executable, args });
228
+ return `${launcher.compileScript}
229
+ $user = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name;
230
+ $action = New-ScheduledTaskAction -Execute ${psString(launcher.path)} -WorkingDirectory ${psString(home)};
157
231
  $trigger = New-ScheduledTaskTrigger -AtLogOn -User $user;
158
232
  $principal = New-ScheduledTaskPrincipal -UserId $user -LogonType Interactive -RunLevel Limited;
159
233
  $settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries -ExecutionTimeLimit ([TimeSpan]::Zero) -MultipleInstances IgnoreNew -Priority 4;
@@ -278,7 +352,7 @@ async function startAutostartService(daemon) {
278
352
  await startService();
279
353
  });
280
354
  } catch (error) {
281
- const { serviceLogger } = await import("./logger-B7B64O4P.js");
355
+ const { serviceLogger } = await import("./logger-NB7VSWM5.js");
282
356
  const { flushLogger } = await import("./logger-24TGGN76.js");
283
357
  serviceLogger.error({ err: getErrorMessage(error) }, "Proxy login startup failed");
284
358
  await flushLogger(serviceLogger);
@@ -289,4 +363,4 @@ export {
289
363
  runAutostartCommand,
290
364
  startAutostartService
291
365
  };
292
- //# sourceMappingURL=autostart-G2MSOPL7.js.map
366
+ //# sourceMappingURL=autostart-XIZTTKSV.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/autostart.ts","../src/common/service-autostart.ts","../src/common/windows-autostart-launcher.ts"],"sourcesContent":["import { homedir, userInfo } from \"node:os\";\nimport { fileURLToPath } from \"node:url\";\nimport { IS_DEV, resolveTopLevelScript } from \"./common/env.js\";\nimport { isInitialized, PROFILE_NAME } from \"./common/paths.js\";\nimport { createServiceAutostart } from \"./common/service-autostart.js\";\nimport { createProfileServiceLifecycle } from \"./common/profile-service.js\";\nimport { refreshLoginShellPath } from \"./common/login-shell-path.js\";\nimport { getErrorMessage } from \"./common/process-probe.js\";\n\nexport async function runAutostartCommand(action: \"enable\" | \"disable\" | \"status\"): Promise<void> {\n try {\n if (action === \"enable\" && !isInitialized()) {\n throw new Error('Dev Anywhere is not initialized. Run \"dev-anywhere init\" first.');\n }\n const entry = `${fileURLToPath(resolveTopLevelScript(\"index\"))}${IS_DEV ? \".ts\" : \".js\"}`;\n const autostart = createServiceAutostart({\n platform: process.platform,\n home: homedir(),\n profile: PROFILE_NAME,\n executable: process.execPath,\n args: IS_DEV ? [\"--import\", import.meta.resolve(\"tsx\"), entry] : [entry],\n env: { ...process.env, SHELL: process.env.SHELL ?? userInfo().shell ?? undefined },\n uid: process.getuid?.(),\n });\n if (action === \"status\") {\n console.log(\n `${PROFILE_NAME}: ${(await autostart.status()) ? \"已设置登录后自动启动\" : \"未设置自动启动\"}`,\n );\n return;\n }\n await autostart[action]();\n console.log(\n action === \"enable\"\n ? `${PROFILE_NAME}: 已设置登录后自动启动,当前 Proxy 不受影响。`\n : `${PROFILE_NAME}: 已取消自动启动,当前 Proxy 不受影响。`,\n );\n } catch (error) {\n console.error(getErrorMessage(error));\n process.exitCode = 1;\n }\n}\n\n/** System login triggers enter the same lifecycle controller as manual CLI commands. */\nexport async function startAutostartService(daemon: boolean): Promise<void> {\n try {\n if (!isInitialized()) throw new Error(\"Proxy configuration is missing\");\n if (process.platform !== \"win32\") {\n const refreshed = await refreshLoginShellPath({\n env: { ...process.env, SHELL: process.env.SHELL ?? userInfo().shell ?? undefined },\n });\n if (refreshed.path !== undefined) process.env.PATH = refreshed.path;\n }\n const lifecycle = createProfileServiceLifecycle();\n if (daemon) await lifecycle.start(\"explicit\");\n else\n await lifecycle.startForeground(async () => {\n const { startService } = await import(\"./serve.js\");\n await startService();\n });\n } catch (error) {\n const { serviceLogger } = await import(\"./common/logger.js\");\n const { flushLogger } = await import(\"@dev-anywhere/shared/logger\");\n serviceLogger.error({ err: getErrorMessage(error) }, \"Proxy login startup failed\");\n await flushLogger(serviceLogger);\n process.exit(1);\n }\n}\n","import { execFile } from \"node:child_process\";\nimport { createHash } from \"node:crypto\";\nimport { mkdir, readFile, unlink, writeFile } from \"node:fs/promises\";\nimport { dirname, join, win32 } from \"node:path\";\nimport { promisify } from \"node:util\";\nimport { buildWindowsAutostartLauncher } from \"./windows-autostart-launcher.js\";\n\ninterface AutostartOptions {\n platform: NodeJS.Platform;\n home: string;\n profile: string;\n executable: string;\n /** Absolute CLI entry and any runtime arguments (e.g. the source-mode TS loader). */\n args: string[];\n env: NodeJS.ProcessEnv;\n uid?: number;\n run?: (command: string, args: string[]) => Promise<string>;\n}\n\nfunction checkText(value: string): string {\n if ([...value].some((char) => char.charCodeAt(0) <= 31 || char.charCodeAt(0) === 127)) {\n throw new Error(\"Autostart paths and environment must not contain control characters\");\n }\n return value;\n}\n\nfunction xml(value: string): string {\n return checkText(value).replace(\n /[&<>\"']/g,\n (char) => ({ \"&\": \"&amp;\", \"<\": \"&lt;\", \">\": \"&gt;\", '\"': \"&quot;\", \"'\": \"&apos;\" })[char]!,\n );\n}\n\nfunction unitString(value: string): string {\n return `\"${checkText(value).replaceAll(\"\\\\\", \"\\\\\\\\\").replaceAll('\"', '\\\\\"').replaceAll(\"%\", \"%%\")}\"`;\n}\n\nfunction psString(value: string): string {\n return `'${checkText(value).replaceAll(\"'\", \"''\")}'`;\n}\n\nfunction encodePowerShell(script: string): string {\n return Buffer.from(script, \"utf16le\").toString(\"base64\");\n}\n\nasync function readIfPresent(path: string): Promise<string | null> {\n try {\n return await readFile(path, \"utf8\");\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === \"ENOENT\") return null;\n throw error;\n }\n}\n\nasync function removeIfPresent(path: string): Promise<void> {\n try {\n await unlink(path);\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== \"ENOENT\") throw error;\n }\n}\n\nconst execFileAsync = promisify(execFile);\n\n/** Registers a login trigger, not another process supervisor. Enabling never restarts a Proxy. */\nexport function createServiceAutostart(options: AutostartOptions) {\n const { platform, home, profile, executable, env } = options;\n if (![\"darwin\", \"linux\", \"win32\"].includes(platform)) {\n throw new Error(`Proxy autostart is not supported on ${platform}`);\n }\n const identity = createHash(\"sha256\").update(`${home}\\0${profile}`).digest(\"hex\").slice(0, 20);\n const label = `dev-anywhere-${identity}`;\n const args = [...options.args, \"--profile\", profile, \"serve\", \"autostart\", \"run\"];\n const run =\n options.run ??\n (async (command: string, commandArgs: string[]) => {\n const result = await execFileAsync(command, commandArgs, {\n timeout: 15_000,\n maxBuffer: 256 * 1024,\n windowsHide: true,\n encoding: \"utf8\",\n });\n return result.stdout;\n });\n const powershell = win32.join(\n env.SystemRoot ?? env.SYSTEMROOT ?? \"C:\\\\Windows\",\n \"System32\",\n \"WindowsPowerShell\",\n \"v1.0\",\n \"powershell.exe\",\n );\n const runPowerShell = (script: string) =>\n run(powershell, [\n \"-NoProfile\",\n \"-NonInteractive\",\n \"-EncodedCommand\",\n encodePowerShell(`$ErrorActionPreference = 'Stop';\\n${script}`),\n ]);\n const taskLookup = `$task = Get-ScheduledTask -ErrorAction Stop | Where-Object { $_.TaskPath -eq '\\\\' -and $_.TaskName -eq ${psString(label)} };`;\n const unit = `${label}.service`;\n const filePath =\n platform === \"darwin\"\n ? join(home, \"Library\", \"LaunchAgents\", `${label}.plist`)\n : join(env.XDG_CONFIG_HOME || join(home, \".config\"), \"systemd\", \"user\", unit);\n const domain = `gui/${options.uid}`;\n const launchdTarget = `${domain}/${label}`;\n\n const environment = {\n HOME: checkText(home),\n ...Object.fromEntries(\n [\"PATH\", \"SHELL\"].flatMap((key) => (env[key] ? [[key, checkText(env[key]!)]] : [])),\n ),\n };\n\n function definition(): string {\n if (platform === \"darwin\") {\n return `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\"><dict>\n<key>Label</key><string>${xml(label)}</string>\n<key>ProgramArguments</key><array>${[executable, ...args].map((arg) => `<string>${xml(arg)}</string>`).join(\"\")}</array>\n<key>WorkingDirectory</key><string>${xml(home)}</string>\n<key>EnvironmentVariables</key><dict>${Object.entries(environment)\n .map(([key, value]) => `<key>${xml(key)}</key><string>${xml(value)}</string>`)\n .join(\"\")}</dict>\n<key>RunAtLoad</key><true/>\n<key>KeepAlive</key><false/>\n</dict></plist>\n`;\n }\n // Keep the unit active after the short-lived start command exits. Otherwise systemd would\n // terminate the detached Proxy (and its updater) along with that command's control group.\n return `[Unit]\nDescription=DEV Anywhere Proxy (${checkText(profile)})\n\n[Service]\nType=oneshot\nRemainAfterExit=yes\nRestart=no\nWorkingDirectory=${unitString(home)}\n${Object.entries(environment)\n .map(([key, value]) => `Environment=${unitString(`${key}=${value}`)}`)\n .join(\"\\n\")}\nExecStart=:${[executable, ...args, \"--daemon\"].map(unitString).join(\" \")}\nTimeoutStartSec=60\n\n[Install]\nWantedBy=default.target\n`;\n }\n\n function windowsTask(): string {\n const launcher = buildWindowsAutostartLauncher({ home, profile, executable, args });\n return `${launcher.compileScript}\n$user = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name;\n$action = New-ScheduledTaskAction -Execute ${psString(launcher.path)} -WorkingDirectory ${psString(home)};\n$trigger = New-ScheduledTaskTrigger -AtLogOn -User $user;\n$principal = New-ScheduledTaskPrincipal -UserId $user -LogonType Interactive -RunLevel Limited;\n$settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries -ExecutionTimeLimit ([TimeSpan]::Zero) -MultipleInstances IgnoreNew -Priority 4;\nRegister-ScheduledTask -TaskPath '\\\\' -TaskName ${psString(label)} -Action $action -Trigger $trigger -Principal $principal -Settings $settings -Description 'DEV Anywhere Proxy: start at user login' -Force | Out-Null;`;\n }\n\n async function status(): Promise<boolean> {\n if (platform === \"win32\") {\n const output = await runPowerShell(\n `${taskLookup}\\n[bool]($task -and $task.Settings.Enabled) | ConvertTo-Json -Compress;`,\n );\n const enabled: unknown = JSON.parse(output.trim());\n if (typeof enabled !== \"boolean\") throw new Error(\"Invalid Windows autostart status\");\n return enabled;\n }\n if ((await readIfPresent(filePath)) === null) return false;\n if (platform === \"darwin\") {\n if (options.uid === undefined) throw new Error(\"Cannot determine the current macOS user\");\n const output = await run(\"/bin/launchctl\", [\"print-disabled\", domain]);\n return !output.includes(`\"${label}\" => true`);\n }\n const output = await run(\"systemctl\", [\n \"--user\",\n \"show\",\n unit,\n \"--property=UnitFileState\",\n \"--value\",\n ]);\n return output.trim() === \"enabled\";\n }\n\n async function enable(): Promise<void> {\n if (platform === \"win32\") {\n await runPowerShell(windowsTask());\n return;\n }\n if (platform === \"darwin\" && options.uid === undefined) {\n throw new Error(\"Cannot determine the current macOS user\");\n }\n const content = definition();\n await mkdir(dirname(filePath), { recursive: true });\n const previous = await readIfPresent(filePath);\n await writeFile(filePath, content, { mode: 0o600 });\n try {\n if (platform === \"darwin\") {\n // No bootstrap/kickstart: registration takes effect at the next login, without touching\n // a running Proxy. An existing system-disabled override must not defeat re-enabling.\n await run(\"/bin/launchctl\", [\"enable\", launchdTarget]);\n } else {\n await run(\"systemctl\", [\"--user\", \"daemon-reload\"]);\n await run(\"systemctl\", [\"--user\", \"enable\", unit]);\n }\n } catch (error) {\n if (previous === null) await removeIfPresent(filePath);\n else await writeFile(filePath, previous, { mode: 0o600 });\n throw error;\n }\n }\n\n async function disable(): Promise<void> {\n if (platform === \"win32\") {\n await runPowerShell(\n `${taskLookup}\\nif ($task) { $task | Unregister-ScheduledTask -Confirm:$false; }`,\n );\n return;\n }\n if ((await readIfPresent(filePath)) === null) return;\n if (platform === \"darwin\") {\n if (options.uid === undefined) throw new Error(\"Cannot determine the current macOS user\");\n await run(\"/bin/launchctl\", [\"disable\", launchdTarget]);\n } else {\n await run(\"systemctl\", [\"--user\", \"disable\", unit]);\n }\n await removeIfPresent(filePath);\n if (platform === \"linux\") await run(\"systemctl\", [\"--user\", \"daemon-reload\"]);\n // Never bootout, stop, or unregister with process termination: disabling only affects login.\n }\n\n return { enable, disable, status };\n}\n","import { createHash } from \"node:crypto\";\nimport { win32 } from \"node:path\";\nimport { quoteWindowsArgument } from \"./command-launch.js\";\nimport { buildProxyProfilePaths } from \"./paths.js\";\n\nfunction encodedString(value: string): string {\n if ([...value].some((char) => char.charCodeAt(0) <= 31 || char.charCodeAt(0) === 127)) {\n throw new Error(\"Autostart paths and environment must not contain control characters\");\n }\n return `Decode(\"${Buffer.from(value, \"utf8\").toString(\"base64\")}\")`;\n}\n\n/** Compile only during registration; the task runs this GUI executable, never PowerShell. */\nexport function buildWindowsAutostartLauncher(options: {\n home: string;\n profile: string;\n executable: string;\n args: readonly string[];\n}): { path: string; logPath: string; source: string; compileScript: string } {\n const paths = buildProxyProfilePaths(options.home, options.profile, \"win32\");\n const logPath = win32.join(paths.logDir, \"autostart-launcher.log\");\n const source = `using System;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Text;\n\ninternal static class DevAnywhereAutostart {\n private static StreamWriter log;\n private static volatile bool logFailed;\n private static string Decode(string value) { return Encoding.UTF8.GetString(Convert.FromBase64String(value)); }\n private static void WriteLog(string stream, string message) {\n if (message == null) return;\n try { lock (log) { log.WriteLine(DateTime.UtcNow.ToString(\"o\") + \" \" + stream + \": \" + message); } }\n catch { logFailed = true; } // Keep draining output; report logging failures through the task exit code.\n }\n public static int Main() {\n try {\n string logPath = ${encodedString(logPath)};\n Directory.CreateDirectory(Path.GetDirectoryName(logPath));\n using (log = new StreamWriter(new FileStream(logPath, FileMode.Append, FileAccess.Write, FileShare.ReadWrite), new UTF8Encoding(false))) {\n log.AutoFlush = true;\n try {\n var info = new ProcessStartInfo();\n info.FileName = ${encodedString(options.executable)};\n info.Arguments = ${encodedString(options.args.map(quoteWindowsArgument).join(\" \"))};\n info.WorkingDirectory = ${encodedString(options.home)};\n info.EnvironmentVariables[\"USERPROFILE\"] = ${encodedString(options.home)};\n info.EnvironmentVariables[\"HOME\"] = ${encodedString(options.home)};\n info.UseShellExecute = false;\n info.CreateNoWindow = true;\n info.RedirectStandardInput = true;\n info.RedirectStandardOutput = true;\n info.RedirectStandardError = true;\n info.StandardOutputEncoding = Encoding.UTF8;\n info.StandardErrorEncoding = Encoding.UTF8;\n using (var child = new Process()) {\n child.StartInfo = info;\n child.OutputDataReceived += (sender, e) => WriteLog(\"stdout\", e.Data);\n child.ErrorDataReceived += (sender, e) => WriteLog(\"stderr\", e.Data);\n child.Start();\n child.StandardInput.Close();\n child.BeginOutputReadLine();\n child.BeginErrorReadLine();\n child.WaitForExit();\n return child.ExitCode != 0 ? child.ExitCode : (logFailed ? 1 : 0);\n }\n } catch (Exception error) { WriteLog(\"launcher\", error.ToString()); return 1; }\n }\n } catch { return 1; } // An unwritable log directory is also a failed task, not a silent success.\n }\n}\n`;\n const digest = createHash(\"sha256\").update(source).digest(\"hex\").slice(0, 20);\n const path = win32.join(paths.profileDir, \"autostart\", `launcher-${digest}.exe`);\n // The source contains only encoded paths/argv, not credentials or a snapshot of the user's env.\n const sourceBase64 = Buffer.from(source, \"utf8\").toString(\"base64\");\n const compileScript = `$launcherPath = '${path.replaceAll(\"'\", \"''\")}';\nif (!(Test-Path -LiteralPath $launcherPath -PathType Leaf)) {\n [System.IO.Directory]::CreateDirectory([System.IO.Path]::GetDirectoryName($launcherPath)) | Out-Null;\n $candidate = $launcherPath + '.' + [guid]::NewGuid().ToString('N') + '.tmp.exe';\n try {\n $source = [System.Text.Encoding]::UTF8.GetString([Convert]::FromBase64String('${sourceBase64}'));\n Add-Type -TypeDefinition $source -OutputAssembly $candidate -OutputType WindowsApplication -ErrorAction Stop;\n Move-Item -LiteralPath $candidate -Destination $launcherPath -ErrorAction Stop;\n } finally {\n if (Test-Path -LiteralPath $candidate) { Remove-Item -LiteralPath $candidate -Force; }\n }\n}`;\n return { path, logPath, source, compileScript };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,SAAS,gBAAgB;AAClC,SAAS,qBAAqB;;;ACD9B,SAAS,gBAAgB;AACzB,SAAS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jF,UAAM,YAAY,aAAa;AAC/B,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF;","names":["createHash","win32","createHash","win32","output"]}
@@ -926,6 +926,7 @@ var RELAY_CONTROL_PROTOCOL_VERSION = 1;
926
926
  var ProxyInfoSchema = z13.object({
927
927
  proxyId: IdSchema,
928
928
  name: z13.string().optional(),
929
+ osName: z13.string().min(1).max(64).optional(),
929
930
  version: z13.string().min(1).max(64),
930
931
  online: z13.boolean(),
931
932
  sessions: z13.array(z13.string())
@@ -1550,6 +1551,7 @@ var relayControlDefinitions = [
1550
1551
  protocolVersion: z13.literal(RELAY_CONTROL_PROTOCOL_VERSION),
1551
1552
  proxyId: IdSchema,
1552
1553
  name: z13.string().optional(),
1554
+ osName: z13.string().min(1).max(64).optional(),
1553
1555
  proxyVersion: z13.string().min(1).max(64)
1554
1556
  }),
1555
1557
  control("proxy_register_response", {
@@ -2825,4 +2827,4 @@ export {
2825
2827
  serializeIpc,
2826
2828
  createIpcReader
2827
2829
  };
2828
- //# sourceMappingURL=chunk-GIFG7KAJ.js.map
2830
+ //# sourceMappingURL=chunk-3KATRUOJ.js.map