auto_agent/edge-agent/scripts/package-linux.ps1
2521690 ce299cbb18 feat: 增加 Agent 演示入口与 app_metadata 驱动验证链路
- 新增 app_metadata 模型、仓储与服务
- 将默认 edge 验证步骤改为由 app_metadata 驱动生成
- 新增 chat_session / chat_message 会话层模型与 chat service
- 新增 demo chat API,支持会话创建、消息发送、任务确认
- 新增最小 Web Demo 页面,形成聊天式演示入口
- 增强任务报告,补充 audit_summary 与更细粒度 task_metrics
- 增强 edge-agent 执行器:tcp_probe、日志时间范围过滤、进程指标与更灵活健康检查
- 更新 README 与当前进度总结,MVP 进度推进到约 94%
2026-04-09 14:10:13 +08:00

31 lines
1.3 KiB
PowerShell

param(
[string]$PythonHome = $env:EDGE_PYTHON_HOME
)
$ErrorActionPreference = "Stop"
if (-not $PythonHome) {
throw "Python runtime directory is required. Pass -PythonHome or set EDGE_PYTHON_HOME."
}
$resolvedPythonHome = (Resolve-Path -LiteralPath $PythonHome).Path
$root = Split-Path -Parent $PSScriptRoot
$dist = Join-Path $root "dist"
$timestamp = Get-Date -Format "yyyyMMdd-HHmmss"
$packageRoot = Join-Path $dist "edge-agent-linux-$timestamp"
$runtimeRoot = Join-Path $packageRoot "runtime\python"
$archivePath = Join-Path $dist "edge-agent-linux-$timestamp.tar.gz"
New-Item -ItemType Directory -Path $packageRoot -Force | Out-Null
New-Item -ItemType Directory -Path $runtimeRoot -Force | Out-Null
New-Item -ItemType Directory -Path $dist -Force | Out-Null
Copy-Item -LiteralPath (Join-Path $root "app") -Destination $packageRoot -Recurse
Copy-Item -LiteralPath (Join-Path $root "README.md") -Destination $packageRoot
Copy-Item -LiteralPath (Join-Path $root "pyproject.toml") -Destination $packageRoot
Copy-Item -LiteralPath (Join-Path $PSScriptRoot "start-linux.sh") -Destination (Join-Path $packageRoot "start.sh")
Get-ChildItem -LiteralPath $resolvedPythonHome -Force | Copy-Item -Destination $runtimeRoot -Recurse
tar -czf $archivePath -C $packageRoot .
Write-Output $archivePath