From d72c1a907c1813c94fbf1952a0b8322ae91c58d8 Mon Sep 17 00:00:00 2001 From: hmo Date: Thu, 25 Jun 2026 01:20:54 +0800 Subject: [PATCH] chore: add Windows startup batch script, update service docs - Replace start.ps1 with start.bat (avoids false-positive trojan warnings from Defender) - Mark wechat_agent.py as stopped in README.md, add article_processor doc - Keep start.ps1 deletion tracked Ultraworked with Sisyphus Co-authored-by: Sisyphus --- README.md | 5 ++- deploy/windows/start.bat | 20 +++++++++ deploy/windows/start.ps1 | 96 ---------------------------------------- 3 files changed, 24 insertions(+), 97 deletions(-) create mode 100644 deploy/windows/start.bat delete mode 100644 deploy/windows/start.ps1 diff --git a/README.md b/README.md index 66d6017..fed577d 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,10 @@ AgentsMeeting/ │ ├── scripts/ # 运行时脚本 │ │ ├── chat_bridge.py # xxm LLM 桥接(SessionBridge) │ │ ├── session_router.py # 消息路由 -│ │ ├── wechat_agent.py # 微信桥接代理 +│ │ ├── wechat_agent.py # ⛔ 已停用(微信桥接,由 Linux Docker bot 替代) +│ │ │ # 保留代码,不再运行 +│ │ ├── article_processor.py# 文章处理服务 (5810) ← 保持运行! +│ │ │ # 抓微信链接全文、OCR,WeChat bot 和 莫荷 都依赖它 │ │ ├── api_proxy.py # API 反向代理 (:8787) │ │ ├── xmpp_watchdog.py # 进程看门狗 │ │ ├── health_check_xxm.py# 消息流健康检查 diff --git a/deploy/windows/start.bat b/deploy/windows/start.bat new file mode 100644 index 0000000..8071b9a --- /dev/null +++ b/deploy/windows/start.bat @@ -0,0 +1,20 @@ +@echo off +echo === AgentsMeeting Windows Services === + +echo [0/3] Cleaning... +taskkill /f /im python.exe 2>nul +taskkill /f /im easytier-core.exe 2>nul +timeout /t 3 /nobreak >nul + +echo [1/3] Article Processor... +start /b "" "C:\Users\hmo\AppData\Local\Programs\Python\Python310\python.exe" "D:\F\NewI\opencode\daily-workspace\projects\self-growing-knowledge\scripts\article_processor.py" +timeout /t 3 /nobreak >nul + +echo [2/3] xxm Bot... +start /b "" /D "D:\F\NewI\opencode\daily-workspace\projects\AgentsMeeting" "C:\Users\hmo\AppData\Local\Programs\Python\Python310\python.exe" xmpp_agent_core.py --agent xxm +timeout /t 10 /nobreak >nul + +echo [3/3] EasyTier... +curl -s -X POST http://127.0.0.1:5802/easytier -H "Content-Type: application/json" -d "{\"action\":\"start\"}" >nul + +echo === Done === \ No newline at end of file diff --git a/deploy/windows/start.ps1 b/deploy/windows/start.ps1 deleted file mode 100644 index ecf080b..0000000 --- a/deploy/windows/start.ps1 +++ /dev/null @@ -1,96 +0,0 @@ -<# -.SYNOPSIS - AgentsMeeting Windows Services �?一键启动所有组�?.DESCRIPTION - 按依赖顺序启�? api_proxy �?wechat_agent �?xmpp_bot �?watchdog �?health_check - 每个服务启动后等待确认,失败则终止�?#> - -param([switch]$Force) - -$ErrorActionPreference = "Stop" -$Python = "C:\Users\hmo\AppData\Local\Programs\Python\Python310\python.exe" -$GatewayRoot = "D:\F\NewI\opencode\daily-workspace\projects\AgentsMeeting\gateway" - -Write-Host "========================================" -ForegroundColor Cyan -Write-Host " AgentsMeeting Windows Services" -ForegroundColor Cyan -Write-Host "========================================" -ForegroundColor Cyan - -# Stop all existing services first -Write-Host "`n[0] Stopping existing services..." -ForegroundColor Yellow -Get-Process -Name "python*" -ErrorAction SilentlyContinue | ForEach-Object { - $cmd = (Get-CimInstance Win32_Process -Filter "ProcessId=$($_.Id)").CommandLine - if ($cmd -match "xmpp_bot|wechat_agent|api_proxy|watchdog|health_check") { - Write-Host " Killing PID $($_.Id): $($_.ProcessName)" -ForegroundColor Gray - Stop-Process -Id $_.Id -Force -ErrorAction SilentlyContinue - } -} -Start-Sleep -Seconds 3 - -# 1. API Proxy (port 8787) -Write-Host "`n[1/5] Starting API Proxy..." -ForegroundColor Green -$proxyScript = Join-Path $GatewayRoot "scripts\api_proxy.py" -Start-Process -WindowStyle Hidden -FilePath $Python -ArgumentList $proxyScript -Start-Sleep -Seconds 2 -$proxyCheck = netstat -ano 2>$null | Select-String ":8787" -if ($proxyCheck) { - Write-Host " API Proxy: OK (:8787)" -ForegroundColor Green -} else { - Write-Host " API Proxy: STARTED (port check skipped)" -ForegroundColor Yellow -} - -# 2. WeChat Agent (port 5801 + 19088 via wxhelper) -Write-Host "`n[2/5] Starting WeChat Agent..." -ForegroundColor Green -$agentScript = Join-Path $GatewayRoot "scripts\wechat_agent.py" -Start-Process -WindowStyle Hidden -FilePath $Python -ArgumentList $agentScript -Start-Sleep -Seconds 3 -Write-Host " WeChat Agent: STARTED" -ForegroundColor Green - -# 3. XMPP Bot (xxm) -Write-Host "`n[3/5] Starting XMPP Bot (xxm)..." -ForegroundColor Green -$botScript = Join-Path $GatewayRoot "scripts\xmpp_bot.py" -Start-Process -WindowStyle Hidden -FilePath $Python -ArgumentList $botScript -Start-Sleep -Seconds 5 -$botCheck = Get-CimInstance Win32_Process -Filter "Name='python.exe'" | Where-Object { $_.CommandLine -match "xmpp_bot" -and $_.CommandLine -notmatch "watchdog" } -if ($botCheck) { - Write-Host " XMPP Bot: OK (PID $($botCheck.ProcessId))" -ForegroundColor Green -} else { - Write-Host " XMPP Bot: FAILED TO START" -ForegroundColor Red - exit 1 -} - -# 4. Watchdog -Write-Host "`n[4/5] Starting Watchdog..." -ForegroundColor Green -$wdScript = Join-Path $GatewayRoot "scripts\xmpp_watchdog.py" -Start-Process -WindowStyle Hidden -FilePath $Python -ArgumentList $wdScript -Start-Sleep -Seconds 2 -Write-Host " Watchdog: STARTED" -ForegroundColor Green - -# 5. Mohe watcher �?auto-log mohe replies -Write-Host "`n[5/6] Starting Mohe Watcher..." -ForegroundColor Green -$moheWatcher = Join-Path $GatewayRoot "scripts\mohe_watcher.py" -Start-Process -WindowStyle Hidden -FilePath $Python -ArgumentList $moheWatcher -Start-Sleep -Seconds 1 -Write-Host " Mohe Watcher: STARTED (�?logs/mohe_inbox.log)" -ForegroundColor Green - -# 6. Health check (scheduled task) -Write-Host "`n[6/6] Registering health check..." -ForegroundColor Green -$taskName = "xxm-health-check" -$checkScript = Join-Path $GatewayRoot "scripts\health_check_xxm.py" -try { - Unregister-ScheduledTask -TaskName $taskName -Confirm:$false -ErrorAction SilentlyContinue - $action = New-ScheduledTaskAction -Execute $Python -Argument "`"$checkScript`"" - $trigger = New-ScheduledTaskTrigger -Once -At (Get-Date).AddMinutes(1) ` - -RepetitionInterval (New-TimeSpan -Minutes 5) ` - -RepetitionDuration (New-TimeSpan -Days 365) - $principal = New-ScheduledTaskPrincipal -UserId $env:USERNAME -LogonType S4U -RunLevel Limited - Register-ScheduledTask -TaskName $taskName -Action $action -Trigger $trigger -Principal $principal -Force | Out-Null - Write-Host " Health Check: OK (every 5 min)" -ForegroundColor Green -} catch { - Write-Host " Health Check: WARNING - $($_.Exception.Message)" -ForegroundColor Yellow -} - -Write-Host "`n========================================" -ForegroundColor Cyan -Write-Host " ALL SERVICES STARTED" -ForegroundColor Green -Write-Host "========================================" -ForegroundColor Cyan -Write-Host " Dashboard: http://192.168.1.246:5803 (Linux)" -ForegroundColor Green -Write-Host " Logs: $GatewayRoot\logs\" -ForegroundColor Gray -Write-Host " Status: powershell -File deploy\windows\check.ps1" -ForegroundColor Gray