Compare commits
3 Commits
ef93f066e3
...
d72c1a907c
| Author | SHA1 | Date | |
|---|---|---|---|
| d72c1a907c | |||
| d406068c89 | |||
| c6795bcb46 |
@@ -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# 消息流健康检查
|
||||
|
||||
@@ -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 ===
|
||||
@@ -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
|
||||
@@ -636,12 +636,16 @@ def process_msg(raw_data):
|
||||
if not urls:
|
||||
urls = re.findall(r'<shareUrlOpen>(https?://mp\.weixin\.qq\.com[^<]+)</shareUrlOpen>', ct)
|
||||
url = urls[0] if urls else None
|
||||
# Decode HTML entities (& → &) — WeChat XML uses & in URLs
|
||||
if url:
|
||||
import html as _html
|
||||
url = _html.unescape(url)
|
||||
# Extract title from XML
|
||||
titles = re.findall(r'<title>(.*?)</title>', ct)
|
||||
title = titles[0] if titles else ""
|
||||
title = _html.unescape(titles[0]) if titles else ""
|
||||
# Extract description
|
||||
descs = re.findall(r'<des>(.*?)</des>', ct)
|
||||
desc = descs[0] if descs else ""
|
||||
desc = _html.unescape(descs[0]) if descs else ""
|
||||
|
||||
if url:
|
||||
log(f"ARTICLE URL: {url}")
|
||||
|
||||
+959
-332
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user