feat: add headless agent management to CLI and both desktop clients

This commit is contained in:
tongtong committed 2026-11-12 21:17:44 +08:00
1 parent e91fa0235c
commit 6916dd54fb
50 files changed
+4837 -148

No files matched your search

+2 -2
View File
@@ -14,8 +14,8 @@ $logFile = Join-Path $logDirectory 'agent.log'
if ((Test-Path -LiteralPath $logFile) -and (Get-Item -LiteralPath $logFile).Length -gt 10MB) {
Move-Item -LiteralPath $logFile -Destination ($logFile + '.1') -Force
}
$arguments = @('--server', [string]$config.server, '--device', [string]$config.device, '--target', [string]$config.target)
if ($config.connect_address) { $arguments += @('--connect-address', [string]$config.connect_address) }
$arguments = if ($config.id -and $config.devices -ne $null) { @('--quiet', '--supervise', '--config', (Join-Path $root 'agent.json')) } else { @('--server', [string]$config.server, '--device', [string]$config.device, '--target', [string]$config.target) }
if (-not $config.id -and $config.connect_address) { $arguments += @('--connect-address', [string]$config.connect_address) }
# Keep the child in this task's process tree. Task Scheduler owns its lifecycle.
# Tracing writes to stdout; stderr is also retained for startup diagnostics.
$ErrorActionPreference = 'Continue'