feat: Batch 5-9 — GrowthIntegration桥接、验证补全、死代码清理、Pipeline模板、Speech/Twitter真实实现
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled

Batch 5 (P0): GrowthIntegration 接入 Tauri
- Kernel 新增 set_viking()/set_extraction_driver() 桥接 SqliteStorage
- 中间件链共享存储,MemoryExtractor 接入 LLM 驱动

Batch 6 (P1): 输入验证 + Heartbeat
- Relay 验证补全(stream 兼容检查、API key 格式校验)
- UUID 类型校验、SessionId 错误返回
- Heartbeat 默认开启 + 首次聊天自动初始化

Batch 7 (P2): 死代码清理
- zclaw-channels 整体移除(317 行)
- multi-agent 特性门控、admin 方法标注

Batch 8 (P2): Pipeline 模板
- PipelineMetadata 新增 annotations 字段
- pipeline_templates 命令 + 2 个示例模板
- fallback driver base_url 修复(doubao/qwen/deepseek 端点)

Batch 9 (P1): SpeechHand/TwitterHand 真实实现
- SpeechHand: tts_method 字段 + Browser TTS 前端集成 (Web Speech API)
- TwitterHand: 12 个 action 全部替换为 Twitter API v2 真实 HTTP 调用
- chatStore/useAutomationEvents 双路径 TTS 触发
This commit is contained in:
iven
2026-03-30 09:24:50 +08:00
parent 5595083b96
commit 13c0b18bbc
39 changed files with 1155 additions and 507 deletions

View File

@@ -84,12 +84,15 @@ if ($Stop) {
}
# Stop Admin dev server (kill process tree to ensure node.exe children die)
$port3000 = netstat -ano | Select-String ":3000.*LISTENING"
if ($port3000) {
$pid3000 = ($port3000 -split '\s+')[-1]
if ($pid3000 -match '^\d+$') {
& taskkill /T /F /PID $pid3000 2>$null
ok "Stopped Admin dev server on port 3000 (PID: $pid3000)"
# Next.js turbopack may use ports 3000-3002
foreach ($adminPort in @(3000, 3001, 3002)) {
$portMatch = netstat -ano | Select-String ":${adminPort}.*LISTENING"
if ($portMatch) {
$adminPid = ($portMatch -split '\s+')[-1]
if ($adminPid -match '^\d+$') {
& taskkill /T /F /PID $adminPid 2>$null
ok "Stopped Admin process on port $adminPort (PID: $adminPid)"
}
}
}
@@ -120,15 +123,19 @@ Write-Host ""
# Track processes for cleanup
$Jobs = @()
$CleanupCalled = $false
function Cleanup {
info "Cleaning up..."
if ($CleanupCalled) { return }
$CleanupCalled = $true
info "Cleaning up child services..."
# Kill tracked process trees (parent + all children)
foreach ($job in $Jobs) {
if ($job -and !$job.HasExited) {
info "Stopping $($job.ProcessName) (PID: $($job.Id)) and child processes"
try {
# taskkill /T kills the entire process tree, not just the parent
& taskkill /T /F /PID $job.Id 2>$null
if (!$job.HasExited) { $job.Kill() }
} catch {
@@ -136,21 +143,34 @@ function Cleanup {
}
}
}
# Fallback: kill processes by known ports
foreach ($port in @(8080, 3000)) {
# Fallback: kill ALL processes on service ports (3000-3002 = Next.js + turbopack)
foreach ($port in @(8080, 3000, 3001, 3002)) {
$listening = netstat -ano | Select-String ":${port}.*LISTENING"
if ($listening) {
$pid = ($listening -split '\s+')[-1]
if ($pid -match '^\d+$') {
info "Killing orphan process on port $port (PID: $pid)"
info "Killing process on port $port (PID: $pid)"
& taskkill /T /F /PID $pid 2>$null
}
}
}
ok "Cleanup complete"
}
# Ctrl+C handler: ensures Cleanup runs even on interrupt
try {
$null = [Console]::CancelKeyPress.Add_Invocation({
param($sender, $e)
$e.Cancel = $true # Prevent immediate termination
Cleanup
})
} catch {
# Not running in an interactive console (e.g. launched via pnpm) - rely on try/finally instead
}
trap { Cleanup; break }
Register-EngineEvent -SourceIdentifier PowerShell.Exiting -Action { Cleanup } | Out-Null
# Skip SaaS and ChromeDriver if DesktopOnly
if ($DesktopOnly) {
@@ -158,7 +178,7 @@ if ($DesktopOnly) {
$NoSaas = $true
}
# 1. PostgreSQL (Windows native) required for SaaS backend
# 1. PostgreSQL (Windows native) - required for SaaS backend
if (-not $NoSaas) {
info "Checking PostgreSQL..."
@@ -247,15 +267,9 @@ if (-not $NoSaas) {
} else {
if (Test-Path "$ScriptDir\admin\package.json") {
info "Starting Admin dashboard on port 3000..."
Set-Location "$ScriptDir\admin"
if ($Dev) {
$proc = Start-Process -FilePath "cmd.exe" -ArgumentList "/c cd /d `"$ScriptDir\admin`" && pnpm dev" -PassThru -WindowStyle Minimized
} else {
$proc = Start-Process -FilePath "cmd.exe" -ArgumentList "/c cd /d `"$ScriptDir\admin`" && pnpm dev" -PassThru -WindowStyle Minimized
}
$proc = Start-Process -FilePath "cmd.exe" -ArgumentList "/c cd /d `"$ScriptDir\admin`" && pnpm dev" -PassThru -WindowStyle Minimized
$Jobs += $proc
Set-Location $ScriptDir
Start-Sleep -Seconds 5
$port3000Check = netstat -ano | Select-String ":3000.*LISTENING"
@@ -275,7 +289,6 @@ if (-not $NoSaas) {
Write-Host ""
# 4. ChromeDriver (optional - for Browser Hand automation)
if (-not $NoBrowser) {
info "Checking ChromeDriver..."
@@ -318,14 +331,19 @@ if ($port1420) {
$pid1420 = ($port1420 -split '\s+')[-1]
if ($pid1420 -match '^\d+$') {
warn "Port 1420 is in use by PID $pid1420. Killing..."
Stop-Process -Id $pid1420 -Force -ErrorAction SilentlyContinue
& taskkill /T /F /PID $pid1420 2>$null
Start-Sleep -Seconds 1
}
}
if ($Dev) {
info "Development mode enabled"
pnpm tauri dev
info "Press Ctrl+C to stop all services..."
try {
pnpm tauri dev
} finally {
Cleanup
}
} else {
$exe = "src-tauri\target\release\ZClaw.exe"
if (Test-Path $exe) {
@@ -337,10 +355,3 @@ if ($Dev) {
pnpm tauri dev
}
}
if ($Dev) {
Write-Host ""
info "Press Ctrl+C to stop all services..."
try { while ($true) { Start-Sleep -Seconds 1 } }
finally { Cleanup }
}