feat: add headless agent management to CLI and both desktop clients
This commit is contained in:
1 parent
e91fa0235c
commit
6916dd54fb
50 files changed
+4837
-148
No files matched your search
@@ -12,7 +12,7 @@ try {
|
||||
if ($LASTEXITCODE -ne 0) { throw 'Desktop publish failed' }
|
||||
} finally { Pop-Location }
|
||||
$suffix = if ($Runtime.StartsWith('win-')) { '.exe' } else { '' }
|
||||
foreach ($toolName in @('ads-client', 'ads-usb')) {
|
||||
foreach ($toolName in @('ads-client', 'ads-usb', 'adsctl', 'ads-agent')) {
|
||||
$client = Join-Path $projectRoot ('bin/' + $toolName + $suffix)
|
||||
if (Test-Path -LiteralPath $client) {
|
||||
Copy-Item -LiteralPath $client -Destination (Join-Path $outputDirectory ($toolName + $suffix)) -Force
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$projectRoot = Split-Path $PSScriptRoot -Parent
|
||||
$output = Join-Path $projectRoot 'bin/flutter-win-x64'
|
||||
Push-Location (Join-Path $projectRoot 'flutter_manager')
|
||||
try {
|
||||
flutter build windows --release
|
||||
if ($LASTEXITCODE -ne 0) { throw 'Flutter publish failed' }
|
||||
} finally { Pop-Location }
|
||||
New-Item -ItemType Directory -Force -Path $output | Out-Null
|
||||
Copy-Item -Path (Join-Path $projectRoot 'flutter_manager/build/windows/x64/runner/Release/*') -Destination $output -Recurse -Force
|
||||
foreach ($name in @('ads-client','ads-agent','adsctl')) {
|
||||
$tool = Join-Path $projectRoot "bin/$name.exe"
|
||||
if (-not (Test-Path -LiteralPath $tool)) { throw "先运行 scripts/build.ps1:缺少 $name" }
|
||||
Copy-Item -LiteralPath $tool -Destination $output -Force
|
||||
}
|
||||
$tools = Join-Path $output 'tools/scrcpy'
|
||||
New-Item -ItemType Directory -Force -Path $tools | Out-Null
|
||||
Copy-Item -Path (Join-Path $projectRoot 'bin/tools/scrcpy/*') -Destination $tools -Recurse -Force
|
||||
# Private credentials are deliberately excluded from distributable artifacts.
|
||||
Write-Host "Flutter published to $output (credentials excluded)"
|
||||
+1
-1
@@ -8,7 +8,7 @@ try {
|
||||
else { cargo build --workspace --release --locked }
|
||||
if ($LASTEXITCODE -ne 0) { throw 'Rust build failed' }
|
||||
New-Item -ItemType Directory -Force -Path (Join-Path $projectRoot 'bin') | Out-Null
|
||||
foreach ($name in @('ads-agent', 'ads-client', 'ads-usb')) {
|
||||
foreach ($name in @('ads-agent', 'ads-client', 'ads-usb', 'adsctl')) {
|
||||
Copy-Item -LiteralPath (Join-Path $projectRoot "target/$configuration/$name.exe") -Destination (Join-Path $projectRoot "bin/$name.exe") -Force
|
||||
}
|
||||
Push-Location (Join-Path $projectRoot 'server')
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ project_root=$(CDPATH='' cd -- "$(dirname -- "$0")/.." && pwd)
|
||||
cd "$project_root"
|
||||
cargo build --workspace --release --locked
|
||||
mkdir -p bin
|
||||
cp target/release/ads-agent target/release/ads-client target/release/ads-usb bin/
|
||||
cp target/release/ads-agent target/release/ads-client target/release/ads-usb target/release/adsctl bin/
|
||||
cd server
|
||||
go build -trimpath -o ../bin/ads-server .
|
||||
go build -trimpath -o ../bin/ads-relay ./cmd/ads-relay
|
||||
@@ -0,0 +1,5 @@
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$projectRoot = Split-Path $PSScriptRoot -Parent
|
||||
$app = Join-Path $projectRoot 'bin/desktop-win-x64/Ads.Desktop.exe'
|
||||
if (-not (Test-Path -LiteralPath $app)) { throw '先运行 scripts/build-desktop.ps1' }
|
||||
Start-Process -FilePath $app -ArgumentList '--agent-tray' -WindowStyle Hidden
|
||||
Reference in new issue
Block a user