@dev-anywhere/proxy 0.9.8 → 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-6DMQS43N.js → autostart-RRSXYZND.js} +97 -36
- package/dist/autostart-RRSXYZND.js.map +1 -0
- 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 +135 -41
- package/dist/update-runner.js.map +1 -1
- package/package.json +3 -3
- package/dist/autostart-6DMQS43N.js.map +0 -1
- 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/{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
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/autostart.ts","../src/common/service-autostart.ts","../src/common/windows-autostart-launcher.ts","../src/common/autostart-definition.ts","../src/common/system-service-autostart.ts","../src/common/windows-service.ts","../src/common/autostart-mode.ts"],"sourcesContent":["import { homedir, userInfo } from \"node:os\";\nimport { fileURLToPath } from \"node:url\";\nimport { setTimeout as sleep } from \"node:timers/promises\";\nimport { IS_DEV, resolveTopLevelScript } from \"./common/env.js\";\nimport { isInitialized, PROFILE_NAME, SERVICE_HOST_PATH } from \"./common/paths.js\";\nimport { createServiceAutostart } from \"./common/service-autostart.js\";\nimport { createSystemServiceAutostart } from \"./common/system-service-autostart.js\";\nimport { switchAutostartMode } from \"./common/autostart-mode.js\";\nimport { requestServiceHost } from \"./common/service-host-control.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(\n action: \"enable\" | \"disable\" | \"status\",\n options: { system?: boolean; now?: boolean } = {},\n): Promise<void> {\n try {\n if (options.now && (action !== \"enable\" || !options.system))\n throw new Error(\"--now requires autostart enable --system\");\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 account = userInfo();\n const settings = {\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 ?? account.shell ?? undefined },\n uid: process.getuid?.(),\n username: account.username,\n };\n const login = createServiceAutostart(settings);\n const system = createSystemServiceAutostart(settings);\n const autostart = options.system ? system : login;\n if (action === \"status\") {\n console.log(\n `${PROFILE_NAME}: ${(await autostart.status()) ? (options.system ? \"已设置开机自动启动(无需桌面登录)\" : \"已设置登录后自动启动\") : \"未设置此模式的自动启动\"}`,\n );\n if (options.system) {\n const host = await requestServiceHost(SERVICE_HOST_PATH, PROFILE_NAME, { action: \"probe\" });\n console.log(\n `Service: ${system.label}; ${host?.status === \"host\" ? `running (PID ${host.pid})` : \"not running\"}`,\n );\n }\n return;\n }\n if (action === \"enable\") await switchAutostartMode(autostart, options.system ? login : system);\n else await autostart.disable();\n if (options.now) {\n const wasRunning = await requestServiceHost(SERVICE_HOST_PATH, PROFILE_NAME, {\n action: \"probe\",\n });\n await system.activate();\n const deadline = Date.now() + 30_000;\n let ready = false;\n while (Date.now() < deadline) {\n const result = await requestServiceHost(SERVICE_HOST_PATH, PROFILE_NAME, {\n action: wasRunning ? \"restart\" : \"start\",\n intent: \"explicit\",\n });\n if (result?.status === \"failed\") throw new Error(result.message);\n if (result?.status === \"ready\") {\n ready = true;\n break;\n }\n await sleep(150);\n }\n if (!ready)\n throw new Error(\n \"System service is registered, but did not become ready; check the OS service status\",\n );\n }\n console.log(\n action === \"enable\"\n ? options.system\n ? `${PROFILE_NAME}: 已设置开机自动启动(无需桌面登录)。${options.now ? \"Proxy 已启动;新建会话可在退出桌面后继续使用。\" : \"下次开机生效;立即启动请加 --now。\"}`\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, system = false): 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 if (system) {\n if (daemon) throw new Error(\"The system service host must remain in the foreground\");\n const { startSystemServiceHost } = await import(\"./service-host.js\");\n await startSystemServiceHost();\n return;\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 automatic startup failed\");\n await flushLogger(serviceLogger);\n process.exit(1);\n }\n}\n","import { execFile } from \"node:child_process\";\nimport { mkdir, writeFile } from \"node:fs/promises\";\nimport { dirname, join, win32 } from \"node:path\";\nimport { promisify } from \"node:util\";\nimport { buildWindowsAutostartLauncher } from \"./windows-autostart-launcher.js\";\nimport {\n autostartLabel,\n checkAutostartText as checkText,\n xmlString as xml,\n unitValue,\n unitString,\n psString,\n readIfPresent,\n removeIfPresent,\n type AutostartOptions,\n} from \"./autostart-definition.js\";\n\nfunction encodePowerShell(script: string): string {\n return Buffer.from(script, \"utf16le\").toString(\"base64\");\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 label = autostartLabel(home, profile);\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=${unitValue(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","import { createHash } from \"node:crypto\";\nimport { readFile, unlink } from \"node:fs/promises\";\n\nexport interface AutostartOptions {\n platform: NodeJS.Platform;\n home: string;\n profile: string;\n executable: string;\n args: string[];\n env: NodeJS.ProcessEnv;\n uid?: number;\n username?: string;\n run?: (command: string, args: string[]) => Promise<string>;\n}\n\nexport function autostartLabel(home: string, profile: string): string {\n return `dev-anywhere-${createHash(\"sha256\").update(`${home}\\0${profile}`).digest(\"hex\").slice(0, 20)}`;\n}\n\nexport function checkAutostartText(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\nexport function xmlString(value: string): string {\n return checkAutostartText(value).replace(\n /[&<>\"']/g,\n (char) => ({ \"&\": \"&\", \"<\": \"<\", \">\": \">\", '\"': \""\", \"'\": \"'\" })[char]!,\n );\n}\n\n/** Scalar directives such as User= and WorkingDirectory= do not remove shell quotes. */\nexport function unitValue(value: string): string {\n return checkAutostartText(value).replaceAll(\"%\", \"%%\");\n}\n\nexport function unitString(value: string): string {\n return `\"${unitValue(value).replaceAll(\"\\\\\", \"\\\\\\\\\").replaceAll('\"', '\\\\\"')}\"`;\n}\n\nexport function psString(value: string): string {\n return `'${checkAutostartText(value).replaceAll(\"'\", \"''\")}'`;\n}\n\nexport async 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\nexport async 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","import { execFile, spawn } from \"node:child_process\";\nimport { mkdtemp, mkdir, rm, writeFile } from \"node:fs/promises\";\nimport { tmpdir } from \"node:os\";\nimport { dirname, join, win32 } from \"node:path\";\nimport { promisify } from \"node:util\";\nimport { z } from \"zod\";\nimport {\n autostartLabel,\n checkAutostartText,\n psString,\n readIfPresent,\n removeIfPresent,\n unitValue,\n unitString,\n xmlString,\n type AutostartOptions,\n} from \"./autostart-definition.js\";\nimport { buildProxyProfilePaths } from \"./paths.js\";\nimport {\n buildWindowsService,\n windowsServiceRegistration,\n WINDOWS_SERVICE_POWERSHELL_PREAMBLE,\n} from \"./windows-service.js\";\n\nconst execFileAsync = promisify(execFile);\nasync function runCommand(command: string, args: string[]): Promise<string> {\n const result = await execFileAsync(command, args, {\n windowsHide: true,\n timeout: 15_000,\n maxBuffer: 256 * 1024,\n encoding: \"utf8\",\n });\n return result.stdout;\n}\nasync function runInteractive(command: string, args: string[]): Promise<string> {\n return new Promise((resolve, reject) => {\n const child = spawn(command, args, { stdio: \"inherit\", windowsHide: false });\n child.once(\"error\", reject);\n child.once(\"exit\", (code) =>\n code === 0\n ? resolve(\"\")\n : reject(\n new Error(`System service registration command exited with code ${code ?? \"unknown\"}`),\n ),\n );\n });\n}\n\nexport function createSystemServiceAutostart(\n options: AutostartOptions & {\n /** Interactive elevation/password prompts happen only during registration and activation. */\n runInteractive?: typeof runInteractive;\n /** An isolated directory for definition tests; production uses the OS-owned directory. */\n systemDirectory?: string;\n },\n) {\n const { platform, home, profile, executable, env } = options;\n if (![\"darwin\", \"linux\", \"win32\"].includes(platform))\n throw new Error(`System services are not supported on ${platform}`);\n const label = `${autostartLabel(home, profile)}-system`;\n const unit = `${label}.service`;\n const paths = buildProxyProfilePaths(home, profile, platform);\n const filePath = join(\n options.systemDirectory ??\n (platform === \"darwin\" ? \"/Library/LaunchDaemons\" : \"/etc/systemd/system\"),\n platform === \"darwin\" ? `${label}.plist` : unit,\n );\n const run = options.run ?? runCommand;\n const interactive = options.runInteractive ?? runInteractive;\n const args = [...options.args, \"--profile\", profile, \"serve\", \"autostart\", \"run\", \"--system\"];\n const environment: Record<string, string> = {\n HOME: checkAutostartText(home),\n ...(platform === \"win32\" ? { USERPROFILE: checkAutostartText(home) } : {}),\n ...Object.fromEntries(\n [\n \"PATH\",\n \"SHELL\",\n \"XDG_CONFIG_HOME\",\n ...(platform === \"win32\" ? [\"APPDATA\", \"LOCALAPPDATA\"] : []),\n ].flatMap((key) => (env[key] ? [[key, checkAutostartText(env[key]!)]] : [])),\n ),\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 lookup = `$service = Get-CimInstance -ClassName Win32_Service -Filter ${psString(`Name='${label}'`)} -ErrorAction Stop;`;\n const powerShell = (script: string) =>\n run(powershell, [\n \"-NoProfile\",\n \"-NonInteractive\",\n \"-EncodedCommand\",\n Buffer.from(`${WINDOWS_SERVICE_POWERSHELL_PREAMBLE}\\n${script}`, \"utf16le\").toString(\n \"base64\",\n ),\n ]);\n const privileged = (command: string, commandArgs: string[]) =>\n interactive(\"/usr/bin/sudo\", [command, ...commandArgs]);\n const requireUser = () => {\n if (!options.uid || !options.username)\n throw new Error(\n \"Run system-service registration as your normal user; it requests sudo only for installation\",\n );\n checkAutostartText(options.username);\n };\n async function stage<T>(\n content: string,\n fn: (path: string) => Promise<T>,\n suffix = \"definition\",\n ): Promise<T> {\n const directory = await mkdtemp(join(tmpdir(), \"dev-anywhere-service-\"));\n const path = join(directory, suffix);\n try {\n await writeFile(path, content, { mode: 0o600 });\n return await fn(path);\n } finally {\n await rm(directory, { recursive: true, force: true });\n }\n }\n async function windowsMutation(script: string) {\n // Capture the profile owner's identity BEFORE UAC, which may use a different administrator.\n const owner = z\n .object({ name: z.string().min(1), sid: z.string().regex(/^S-1-/) })\n .parse(\n JSON.parse(\n await powerShell(\n \"$identity = [Security.Principal.WindowsIdentity]::GetCurrent(); @{ name = $identity.Name; sid = $identity.User.Value } | ConvertTo-Json -Compress;\",\n ),\n ),\n );\n const source = `param([switch]$Elevated)\n${WINDOWS_SERVICE_POWERSHELL_PREAMBLE}\n$principal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent());\nif (!$principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {\n if ($Elevated) { throw 'Administrator privileges are required to install a system service'; }\n $child = Start-Process -FilePath ${psString(powershell)} -ArgumentList @('-NoProfile', '-ExecutionPolicy', 'Bypass', '-File', ('\"' + $PSCommandPath + '\"'), '-Elevated') -Verb RunAs -Wait -PassThru;\n exit $child.ExitCode;\n}\ntry {\n $ownerName = ${psString(owner.name)};\n $ownerSid = ${psString(owner.sid)};\n ${lookup}\n if ($service) {\n $account = New-Object Security.Principal.NTAccount($service.StartName);\n if ($account.Translate([Security.Principal.SecurityIdentifier]).Value -ne $ownerSid) { throw 'Existing service belongs to another account'; }\n }\n ${script}\n} catch {\n Write-Error $_ -ErrorAction Continue;\n if ($Elevated) { Read-Host 'Service operation failed. Press Enter to close this window' | Out-Null; }\n exit 1;\n}\n`;\n // A file avoids Windows' command-line length limit; it contains no password or tokens.\n await stage(\n `\\ufeff${source}`,\n (path) =>\n interactive(powershell, [\"-NoProfile\", \"-ExecutionPolicy\", \"Bypass\", \"-File\", path]),\n \"register.ps1\",\n );\n }\n function definition(): string {\n requireUser();\n const user = options.username!;\n const userEnv = { ...environment, USER: user, LOGNAME: user };\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>${xmlString(label)}</string>\n<key>UserName</key><string>${xmlString(user)}</string>\n<key>ProgramArguments</key><array>${[executable, ...args].map((arg) => `<string>${xmlString(arg)}</string>`).join(\"\")}</array>\n<key>WorkingDirectory</key><string>${xmlString(home)}</string>\n<key>EnvironmentVariables</key><dict>${Object.entries(userEnv)\n .map(([key, value]) => `<key>${xmlString(key)}</key><string>${xmlString(value)}</string>`)\n .join(\"\")}</dict>\n<key>RunAtLoad</key><true/>\n<key>KeepAlive</key><false/>\n<key>ExitTimeOut</key><integer>120</integer>\n</dict></plist>\n`;\n return `[Unit]\nDescription=DEV Anywhere system service (${checkAutostartText(profile)})\nWants=network-online.target\nAfter=network-online.target\nRequiresMountsFor=${unitString(home)}\n\n[Service]\nType=simple\nUser=${unitValue(user)}\nWorkingDirectory=${unitValue(home)}\n${Object.entries(userEnv)\n .map(([key, value]) => `Environment=${unitString(`${key}=${value}`)}`)\n .join(\"\\n\")}\nExecStart=:${[executable, ...args].map(unitString).join(\" \")}\nRestart=no\nTimeoutStopSec=120\n\n[Install]\nWantedBy=multi-user.target\n`;\n }\n const install = (source: string) =>\n privileged(\"/usr/bin/install\", [\n \"-o\",\n \"root\",\n \"-g\",\n platform === \"darwin\" ? \"wheel\" : \"root\",\n \"-m\",\n \"644\",\n source,\n filePath,\n ]);\n async function status(): Promise<boolean> {\n if (platform === \"win32\") {\n return z\n .boolean()\n .parse(\n JSON.parse(\n (\n await powerShell(\n `${lookup}\\n[bool]($service -and $service.StartMode -eq 'Auto') | ConvertTo-Json -Compress;`,\n )\n ).trim(),\n ),\n );\n }\n if ((await readIfPresent(filePath)) === null) return false;\n if (platform === \"darwin\")\n return !(await run(\"/bin/launchctl\", [\"print-disabled\", \"system\"])).includes(\n `\"${label}\" => true`,\n );\n return (\n (\n await run(\"systemctl\", [\"--system\", \"show\", unit, \"--property=UnitFileState\", \"--value\"])\n ).trim() === \"enabled\"\n );\n }\n async function enable(): Promise<void> {\n if (platform === \"win32\") {\n const wrapper = buildWindowsService({\n home,\n profile,\n label,\n executable,\n args,\n env: environment,\n });\n await windowsMutation(\n `${wrapper.compileScript}\\n${windowsServiceRegistration(label, wrapper.path)}`,\n );\n } else {\n const content = definition();\n const previous = await readIfPresent(filePath);\n await stage(content, install);\n try {\n if (platform === \"darwin\")\n await privileged(\"/bin/launchctl\", [\"enable\", `system/${label}`]);\n else {\n await privileged(\"systemctl\", [\"--system\", \"daemon-reload\"]);\n await privileged(\"systemctl\", [\"--system\", \"enable\", unit]);\n }\n } catch (error) {\n if (previous === null) await privileged(\"/bin/rm\", [\"-f\", filePath]);\n else await stage(previous, install);\n if (platform === \"linux\") await privileged(\"systemctl\", [\"--system\", \"daemon-reload\"]);\n throw error;\n }\n }\n await mkdir(dirname(paths.systemAutostartPath), { recursive: true });\n await writeFile(paths.systemAutostartPath, `${label}\\n`, { mode: 0o600 });\n }\n async function disable(): Promise<void> {\n if (platform === \"win32\") {\n if (await status())\n await windowsMutation(`if ($service) {\n $result = Invoke-CimMethod -InputObject $service -MethodName ChangeStartMode -Arguments @{ StartMode = 'Disabled' };\n if ($result.ReturnValue -ne 0) { throw ('Service disable failed: ' + $result.ReturnValue); }\n}`);\n } else if ((await readIfPresent(filePath)) !== null) {\n requireUser();\n if (platform === \"darwin\") await privileged(\"/bin/launchctl\", [\"disable\", `system/${label}`]);\n else await privileged(\"systemctl\", [\"--system\", \"disable\", unit]);\n await privileged(\"/bin/rm\", [\"-f\", filePath]);\n if (platform === \"linux\") await privileged(\"systemctl\", [\"--system\", \"daemon-reload\"]);\n }\n await removeIfPresent(paths.systemAutostartPath);\n }\n async function activate(): Promise<void> {\n if (platform === \"win32\") {\n await windowsMutation(\n `if (!$service) { throw 'System service is not installed'; }\\nStart-Service -Name ${psString(label)};`,\n );\n } else if (platform === \"darwin\") {\n requireUser();\n let loaded = false;\n try {\n await run(\"/bin/launchctl\", [\"print\", `system/${label}`]);\n loaded = true;\n } catch (error) {\n // launchctl uses ESRCH (3/113) for an unloaded service. Other failures must remain visible.\n if (![3, 113].includes(Number((error as { code?: unknown }).code))) throw error;\n }\n if (!loaded) await privileged(\"/bin/launchctl\", [\"bootstrap\", \"system\", filePath]);\n else await privileged(\"/bin/launchctl\", [\"kickstart\", `system/${label}`]);\n } else {\n requireUser();\n await privileged(\"systemctl\", [\"--system\", \"start\", unit]);\n }\n }\n return { label, filePath, enable, disable, status, activate };\n}\n","import { createHash } from \"node:crypto\";\nimport { win32 } from \"node:path\";\nimport { buildProxyProfilePaths } from \"./paths.js\";\nimport { quoteWindowsArgument } from \"./command-launch.js\";\nimport { checkAutostartText, psString } from \"./autostart-definition.js\";\n\n// A CLI launched from pwsh can inherit PowerShell 7 modules, incompatible with powershell.exe.\nexport const WINDOWS_SERVICE_POWERSHELL_PREAMBLE = `$ErrorActionPreference = 'Stop';\n$env:PSModulePath = $PSHOME + '\\\\Modules';\n$ProgressPreference = 'SilentlyContinue';\n[Console]::OutputEncoding = [Text.UTF8Encoding]::new($false);`;\n\nfunction encoded(value: string): string {\n return `Decode(\"${Buffer.from(checkAutostartText(value), \"utf8\").toString(\"base64\")}\")`;\n}\n\n/** An SCM service, running as the user's account. Node itself does not implement ServiceMain. */\nexport function buildWindowsService(options: {\n home: string;\n profile: string;\n label: string;\n executable: string;\n args: string[];\n env: Record<string, string>;\n}) {\n const paths = buildProxyProfilePaths(options.home, options.profile, \"win32\");\n const logPath = win32.join(paths.logDir, \"system-service.log\");\n const source = `using System;\nusing System.Diagnostics;\nusing System.IO;\nusing System.ServiceProcess;\nusing System.Text;\nusing System.Threading;\n\npublic sealed class DevAnywhereService : ServiceBase {\n private Process child;\n private StreamWriter log;\n private volatile bool stopping;\n private static string Decode(string value) { return Encoding.UTF8.GetString(Convert.FromBase64String(value)); }\n public DevAnywhereService() {\n ServiceName = ${encoded(options.label)};\n CanStop = true; CanShutdown = true; AutoLog = false;\n }\n private void WriteLog(string stream, string message) {\n if (message == null || log == null) return;\n try { lock (log) { log.WriteLine(DateTime.UtcNow.ToString(\"o\") + \" \" + stream + \": \" + message); } }\n catch { } // Draining the child's pipes must continue even if its log disk fills.\n }\n private void StartChild() {\n string logPath = ${encoded(logPath)};\n Directory.CreateDirectory(Path.GetDirectoryName(logPath));\n log = new StreamWriter(new FileStream(logPath, FileMode.Append, FileAccess.Write, FileShare.ReadWrite), new UTF8Encoding(false));\n log.AutoFlush = true;\n var info = new ProcessStartInfo();\n info.FileName = ${encoded(options.executable)};\n info.Arguments = ${encoded(options.args.map(quoteWindowsArgument).join(\" \"))};\n info.WorkingDirectory = ${encoded(options.home)};\n ${Object.entries(options.env)\n .map(([key, value]) => `info.EnvironmentVariables[${encoded(key)}] = ${encoded(value)};`)\n .join(\"\\n \")}\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 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.BeginOutputReadLine();\n child.BeginErrorReadLine();\n }\n protected override void OnStart(string[] args) {\n StartChild();\n ThreadPool.QueueUserWorkItem(_ => {\n child.WaitForExit();\n if (!stopping) { ExitCode = child.ExitCode; Stop(); }\n });\n }\n private void StopChild(bool requestedStop) {\n stopping = true;\n if (child == null) return;\n if (!child.HasExited) {\n if (requestedStop) RequestAdditionalTime(120000);\n try { child.StandardInput.WriteLine(\"stop\"); child.StandardInput.Flush(); }\n catch (IOException) { }\n if (!child.WaitForExit(110000)) { child.Kill(); ExitCode = 1; }\n }\n }\n protected override void OnStop() { StopChild(true); }\n protected override void OnShutdown() { StopChild(false); }\n public static int Main(string[] args) {\n using (var service = new DevAnywhereService()) {\n // Native tests exercise the compiled process/pipe contract without installing an OS service.\n if (args.Length == 1 && (args[0] == \"--console-test\" || args[0] == \"--console-shutdown-test\")) {\n try {\n service.StartChild();\n ThreadPool.QueueUserWorkItem(_ => {\n Console.ReadLine();\n if (args[0] == \"--console-shutdown-test\") { service.OnShutdown(); return; }\n try { service.child.StandardInput.WriteLine(\"stop\"); service.child.StandardInput.Flush(); }\n catch (IOException) { }\n });\n service.child.WaitForExit();\n return service.child.ExitCode;\n } catch (Exception error) { service.WriteLog(\"host\", error.ToString()); return 1; }\n }\n ServiceBase.Run(service);\n return 0;\n }\n }\n}\n`;\n const digest = createHash(\"sha256\").update(source).digest(\"hex\").slice(0, 20);\n const path = win32.join(paths.profileDir, \"autostart\", `service-${digest}.exe`);\n const compileScript = `$servicePath = ${psString(path)};\nif (!(Test-Path -LiteralPath $servicePath -PathType Leaf)) {\n [IO.Directory]::CreateDirectory([IO.Path]::GetDirectoryName($servicePath)) | Out-Null;\n $candidate = $servicePath + '.' + [guid]::NewGuid().ToString('N') + '.tmp.exe';\n try {\n $source = [Text.Encoding]::UTF8.GetString([Convert]::FromBase64String('${Buffer.from(source).toString(\"base64\")}'));\n Add-Type -TypeDefinition $source -ReferencedAssemblies 'System.dll','System.ServiceProcess.dll' -OutputAssembly $candidate -OutputType WindowsApplication -ErrorAction Stop;\n Move-Item -LiteralPath $candidate -Destination $servicePath -ErrorAction Stop;\n } finally { if (Test-Path -LiteralPath $candidate) { Remove-Item -LiteralPath $candidate -Force; } }\n}`;\n return { path, source, logPath, compileScript };\n}\n\nexport function windowsServiceRegistration(label: string, binaryPath: string): string {\n return `$binaryPath = ${psString(quoteWindowsArgument(binaryPath))};\nif ($service) {\n $account = New-Object Security.Principal.NTAccount($service.StartName);\n if ($account.Translate([Security.Principal.SecurityIdentifier]).Value -ne $ownerSid) { throw 'Existing service belongs to another account'; }\n $result = Invoke-CimMethod -InputObject $service -MethodName Change -Arguments @{ PathName = $binaryPath; StartMode = 'Automatic' };\n if ($result.ReturnValue -ne 0) { throw ('Service update failed: ' + $result.ReturnValue); }\n} else {\n $credential = Get-Credential -UserName $ownerName -Message 'DEV Anywhere: enter this Windows account password for startup before desktop login (not the Windows Hello PIN)';\n if (!$credential) { throw 'Service installation cancelled'; }\n $account = New-Object Security.Principal.NTAccount($credential.UserName);\n if ($account.Translate([Security.Principal.SecurityIdentifier]).Value -ne $ownerSid) { throw 'Use the same account that owns this DEV Anywhere profile'; }\n Add-Type -AssemblyName System.ServiceProcess;\n Add-Type -AssemblyName System.Configuration.Install;\n $processInstaller = New-Object System.ServiceProcess.ServiceProcessInstaller;\n $processInstaller.Account = [System.ServiceProcess.ServiceAccount]::User;\n $processInstaller.Username = $ownerName;\n $processInstaller.Password = $credential.GetNetworkCredential().Password;\n $installer = New-Object System.ServiceProcess.ServiceInstaller;\n $installer.ServiceName = ${psString(label)};\n $installer.DisplayName = ${psString(`DEV Anywhere (${label})`)};\n $installer.Description = 'DEV Anywhere Proxy: run before desktop login as the profile owner';\n $installer.StartType = [System.ServiceProcess.ServiceStartMode]::Automatic;\n $processInstaller.Installers.Add($installer) | Out-Null;\n $processInstaller.Context = New-Object System.Configuration.Install.InstallContext($null, @('/LogToConsole=false'));\n $processInstaller.Context.Parameters['assemblypath'] = $binaryPath;\n $state = @{};\n try {\n # ServiceProcessInstaller grants SeServiceLogonRight and rolls it back on failed installation.\n $processInstaller.Install($state);\n $processInstaller.Commit($state);\n } catch { $processInstaller.Rollback($state); throw; }\n finally { $processInstaller.Password = $null; $credential = $null; }\n}`;\n}\n","interface AutostartRegistration {\n status(): Promise<boolean>;\n enable(): Promise<void>;\n disable(): Promise<void>;\n}\n\n/** Install the replacement first. Failure must not leave the user with no startup registration. */\nexport async function switchAutostartMode(\n selected: AutostartRegistration,\n previous: AutostartRegistration,\n): Promise<void> {\n const alreadyEnabled = await selected.status();\n const previousEnabled = await previous.status();\n await selected.enable();\n try {\n await previous.disable();\n } catch (error) {\n // Disable can fail after changing OS state (for example when removing the old file fails).\n // Restore that mode before rolling back the replacement, so there is always a startup path.\n if (previousEnabled) await previous.enable();\n if (!alreadyEnabled) await selected.disable();\n throw error;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,SAAS,gBAAgB;AAClC,SAAS,qBAAqB;AAC9B,SAAS,cAAc,aAAa;;;ACFpC,SAAS,gBAAgB;AACzB,SAAS,OAAO,iBAAiB;AACjC,SAAS,SAAS,MAAM,SAAAA,cAAa;AACrC,SAAS,iBAAiB;;;ACH1B,SAAS,kBAAkB;AAC3B,SAAS,aAAa;AAItB,SAAS,cAAc,OAAuB;AAC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,MAAM,gBAAgB,KAAK,CAAC;AACpC,YAAQ,WAAW;AAAA,EACrB;AACF;AAGA,eAAsB,sBAAsB,QAAiB,SAAS,OAAsB;AAC1F,MAAI;AACF,QAAI,CAAC,cAAc,EAAG,OAAM,IAAI,MAAM,gCAAgC;AACtE,QAAI,QAAQ,aAAa,SAAS;AAChC,YAAM,YAAY,MAAM,sBAAsB;AAAA,QAC5C,KAAK,EAAE,GAAG,QAAQ,KAAK,OAAO,QAAQ,IAAI,SAAS,SAAS,EAAE,SAAS,OAAU;AAAA,MACnF,CAAC;AACD,UAAI,UAAU,SAAS,OAAW,SAAQ,IAAI,OAAO,UAAU;AAAA,IACjE;AACA,QAAI,QAAQ;AACV,UAAI,OAAQ,OAAM,IAAI,MAAM,uDAAuD;AACnF,YAAM,EAAE,uBAAuB,IAAI,MAAM,OAAO,4BAAmB;AACnE,YAAM,uBAAuB;AAC7B;AAAA,IACF;AACA,UAAM,YAAY,8BAA8B;AAChD,QAAI,OAAQ,OAAM,UAAU,MAAM,UAAU;AAAA;AAE1C,YAAM,UAAU,gBAAgB,YAAY;AAC1C,cAAM,EAAE,aAAa,IAAI,MAAM,OAAO,YAAY;AAClD,cAAM,aAAa;AAAA,MACrB,CAAC;AAAA,EACL,SAAS,OAAO;AACd,UAAM,EAAE,cAAc,IAAI,MAAM,OAAO,sBAAoB;AAC3D,UAAM,EAAE,YAAY,IAAI,MAAM,OAAO,sBAA6B;AAClE,kBAAc,MAAM,EAAE,KAAK,gBAAgB,KAAK,EAAE,GAAG,gCAAgC;AACrF,UAAM,YAAY,aAAa;AAC/B,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF;","names":["win32","createHash","win32","output","execFile","mkdir","writeFile","dirname","join","win32","promisify","createHash","win32","win32","createHash","execFileAsync","promisify","execFile","join","win32","writeFile","mkdir","dirname"]}
|
package/dist/chunk-77QVUYU7.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
// src/common/local-ipc-endpoint.ts
|
|
4
|
-
import { chmodSync, existsSync, mkdirSync } 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/local-ipc-endpoint.ts
|
|
19
|
-
function isNamedPipeEndpoint(endpoint) {
|
|
20
|
-
return /^\\\\[.?]\\pipe\\/i.test(endpoint);
|
|
21
|
-
}
|
|
22
|
-
function prepareLocalIpcEndpoint(endpoint) {
|
|
23
|
-
if (!isNamedPipeEndpoint(endpoint)) mkdirSync(dirname(endpoint), { recursive: true });
|
|
24
|
-
}
|
|
25
|
-
function setLocalIpcEndpointPermissions(endpoint) {
|
|
26
|
-
if (!isNamedPipeEndpoint(endpoint)) chmodSync(endpoint, 384);
|
|
27
|
-
}
|
|
28
|
-
function removeLocalIpcEndpoint(endpoint) {
|
|
29
|
-
if (!isNamedPipeEndpoint(endpoint)) unlinkIfPresent(endpoint);
|
|
30
|
-
}
|
|
31
|
-
function localIpcEndpointMayExist(endpoint) {
|
|
32
|
-
return isNamedPipeEndpoint(endpoint) || existsSync(endpoint);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export {
|
|
36
|
-
unlinkIfPresent,
|
|
37
|
-
prepareLocalIpcEndpoint,
|
|
38
|
-
setLocalIpcEndpointPermissions,
|
|
39
|
-
removeLocalIpcEndpoint,
|
|
40
|
-
localIpcEndpointMayExist
|
|
41
|
-
};
|
|
42
|
-
//# sourceMappingURL=chunk-77QVUYU7.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/common/local-ipc-endpoint.ts","../src/common/safe-unlink.ts"],"sourcesContent":["import { chmodSync, existsSync, mkdirSync } from \"node:fs\";\nimport { dirname } from \"node:path\";\nimport { unlinkIfPresent } from \"./safe-unlink.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 // Node uses the Windows pipe DACL; chmod is a filesystem operation, not a pipe ACL setter.\n // Do not enable readableAll/writableAll. Listeners must not send data before a client writes.\n if (!isNamedPipeEndpoint(endpoint)) 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"],"mappings":";;;AAAA,SAAS,WAAW,YAAY,iBAAiB;AACjD,SAAS,eAAe;;;ACDxB,SAAS,kBAAkB;AAIpB,SAAS,gBAAgB,MAAc,SAAmB,YAAkB;AACjF,MAAI;AACF,WAAO,IAAI;AAAA,EACb,SAAS,KAAK;AACZ,QAAK,IAA8B,SAAS,SAAU;AACtD,UAAM;AAAA,EACR;AACF;;;ADPO,SAAS,oBAAoB,UAA2B;AAC7D,SAAO,qBAAqB,KAAK,QAAQ;AAC3C;AAEO,SAAS,wBAAwB,UAAwB;AAC9D,MAAI,CAAC,oBAAoB,QAAQ,EAAG,WAAU,QAAQ,QAAQ,GAAG,EAAE,WAAW,KAAK,CAAC;AACtF;AAEO,SAAS,+BAA+B,UAAwB;AAGrE,MAAI,CAAC,oBAAoB,QAAQ,EAAG,WAAU,UAAU,GAAK;AAC/D;AAEO,SAAS,uBAAuB,UAAwB;AAE7D,MAAI,CAAC,oBAAoB,QAAQ,EAAG,iBAAgB,QAAQ;AAC9D;AAGO,SAAS,yBAAyB,UAA2B;AAClE,SAAO,oBAAoB,QAAQ,KAAK,WAAW,QAAQ;AAC7D;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
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 // 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\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 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;AAsBA,SAAS,cAAc,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AO;AAAA,EACT;AACF;AAGA,IAAM,gBAAgB,IAAI,YAAY,mBAAmB;AACzD,IAAM,kBAAkB,QAAQ,IAAI,8BAA8B;AAE3D,IAAM,gBAAgB,aAAa;AAAA,EACxC,MAAM,kBAAkB,mBAAmB;AAAA,EAC3C,OAAO,iBAAiB;AAAA,EACxB,QAAQ;AAAA,EACR,QAAQ,IAAI;AACd,CAAC;AAGM,IAAM,iBAAiB,kBAC1B,gBACA,aAAa;AAAA,EACX,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"]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|